diff options
author | 2023-09-04 15:55:17 +0200 | |
---|---|---|
committer | 2023-09-04 14:55:17 +0100 | |
commit | 3ed1ca68e52527f74103e1a57ae48ae533508c3a (patch) | |
tree | d6113d71d6f88a3d99bbd2215ead6ca1d4fa6153 /internal/workers/workers.go | |
parent | [chore]: Bump golang.org/x/image from 0.11.0 to 0.12.0 (#2178) (diff) | |
download | gotosocial-3ed1ca68e52527f74103e1a57ae48ae533508c3a.tar.xz |
[feature] Store admin actions in the db, prevent conflicting actions (#2167)
Diffstat (limited to 'internal/workers/workers.go')
-rw-r--r-- | internal/workers/workers.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/workers/workers.go b/internal/workers/workers.go index 965cf1d2a..8f884d427 100644 --- a/internal/workers/workers.go +++ b/internal/workers/workers.go @@ -45,6 +45,19 @@ type Workers struct { EnqueueClientAPI func(context.Context, ...messages.FromClientAPI) EnqueueFediAPI func(context.Context, ...messages.FromFediAPI) + // Blocking processing functions for clientAPI / federator. + // These are pointers to Processor{}.Process___() msg functions. + // This prevents dependency cycling as Processor depends on Workers. + // + // Rather than queueing messages for asynchronous processing, these + // functions will process immediately and in a blocking manner, and + // will not use up a worker slot. + // + // As such, you should only call them in special cases where something + // synchronous needs to happen before you can do something else. + ProcessFromClientAPI func(context.Context, messages.FromClientAPI) error + ProcessFromFediAPI func(context.Context, messages.FromFediAPI) error + // Media manager worker pools. Media runners.WorkerPool |