aboutsummaryrefslogtreecommitdiffstats
path: root/worker/mbox/worker.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-06-21 22:13:01 +0200
committerRobin Jarry <robin@jarry.cc>2023-06-22 10:55:25 +0200
commit697b56b6d3071aab78a3b81114ba39618b59848f (patch)
treeb355c44c3d1f5bb295b2f31c2655a3fdd6854f0c /worker/mbox/worker.go
parent0fc5ffb260f764f2e7313506aa0f73ad98cbea40 (diff)
downloadaerc-697b56b6d3071aab78a3b81114ba39618b59848f.tar.gz
worker: add WorkerInteractor interface
Add a WorkerInteractor interface. Avoid exposing any public fields in the types.Worker. This will set the stage to implement a middleware pattern for the workers, i.e. to map folder names between the ui and the backend. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/mbox/worker.go')
-rw-r--r--worker/mbox/worker.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/worker/mbox/worker.go b/worker/mbox/worker.go
index 0e6c64d1..5034f66d 100644
--- a/worker/mbox/worker.go
+++ b/worker/mbox/worker.go
@@ -374,7 +374,7 @@ func (w *mboxWorker) handleMessage(msg types.WorkerMessage) error {
}
func (w *mboxWorker) Run() {
- for msg := range w.worker.Actions {
+ for msg := range w.worker.Actions() {
msg = w.worker.ProcessAction(msg)
if err := w.handleMessage(msg); errors.Is(err, errUnsupported) {
w.worker.PostMessage(&types.Unsupported{