aboutsummaryrefslogtreecommitdiff
path: root/worker
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-01-11 09:04:18 -0500
committerDrew DeVault <sir@cmpwn.com>2018-01-11 09:04:18 -0500
commit4074445cbb45dc6ec132e67b7eac9f32dcfd53de (patch)
treeabb2348df84e12f0a781a4e0d29509962d01c756 /worker
parentffba56133406027a6a740f9f4454b27134143f0a (diff)
Move worker into account tab
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/worker.go9
-rw-r--r--worker/types/messages.go2
-rw-r--r--worker/worker.go2
3 files changed, 4 insertions, 9 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index 14e4004..080927d 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -18,13 +18,8 @@ func NewIMAPWorker() *IMAPWorker {
}
}
-func (w *IMAPWorker) GetMessage() types.WorkerMessage {
- select {
- case msg := <-w.messages:
- return msg
- default:
- return nil
- }
+func (w *IMAPWorker) GetMessages() chan types.WorkerMessage {
+ return w.messages
}
func (w *IMAPWorker) PostAction(msg types.WorkerMessage) {
diff --git a/worker/types/messages.go b/worker/types/messages.go
index 845bb86..a4d8ddb 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -33,7 +33,7 @@ type Ping struct {
type Configure struct {
Message
- Config config.AccountConfig
+ Config *config.AccountConfig
}
type Connect struct {
diff --git a/worker/worker.go b/worker/worker.go
index da7928e..c8ec622 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -9,7 +9,7 @@ import (
)
type Worker interface {
- GetMessage() types.WorkerMessage
+ GetMessages() chan types.WorkerMessage
PostAction(types.WorkerMessage)
Run()
}