about summary refs log tree commit diff stats
path: root/worker/types/worker.go
Commit message (Collapse)AuthorAgeFilesLines
* Remove worker callbacks when Done is receivedDrew DeVault2019-06-021-4/+12
|
* worker/types/worker: remove mutexSimon Ser2019-05-191-36/+21
| | | | | | | | | | Worker.callbacks contains two types of callbacks: some are action callbacks, some are message callbacks. Each of those is access from one side of the communication channel (UI goroutine vs. worker goroutine). Instead of using a channel, we can use two different maps for each kind. This simplifies the code and also ensures we don't call an action callback instead of a message callback (or the other way around).
* worker/types/worker: make ID allocation atomicSimon Ser2019-05-191-5/+6
| | | | | | | | Message IDs are allocated for both messages from UI to workers and the other way around. Hence, the global nextId variable is accessed from multiple goroutines. Instead, use atomic to access the global counter.
* worker/types/worker: set ID before sending messageSimon Ser2019-05-191-3/+9
| | | | | The previous code set the message ID after sending it, which could result in the receiver reading the ID before it's set.
* Copy sent emails to the Sent folderDrew DeVault2019-05-151-4/+12
| | | | Or rather, to a user-specified folder
* worker/types: fix Worker.Callbacks race conditionSimon Ser2019-04-271-15/+41
| | | | | | | | | | | | | Worker.Process* functions were called in different goroutines than Worker.Post*. Protect the map with a mutex. Also make the map unexported to prevent external unprotected accesses. Worker.Process* functions used to delete items from the map. However they didn't delete the element they retrieved: callbacks[msg.InResponseTo()] was read while callbacks[msg] was deleted. I'm not sure I understand why. I tried to delete the element that was accessed - but this broke everything (UI froze at "Connecting..."). I don't believe any elements were actually removed from the map, so the new code just doesn't remove anything.
* Improve loggingDrew DeVault2018-02-011-6/+20
|
* Reduce boilerplate in worker/UIDrew DeVault2018-02-011-0/+59