diff options
author | 2022-04-28 13:23:11 +0100 | |
---|---|---|
committer | 2022-04-28 13:23:11 +0100 | |
commit | 420e2fb22bc7aa4967ddadb11e444079efdf5117 (patch) | |
tree | 413842c5df646c30a8079671ade5e677e3825fb8 /internal/processing/status/status.go | |
parent | [bugfix] Fix possible race condition in federatingdb (#490) (diff) | |
download | gotosocial-420e2fb22bc7aa4967ddadb11e444079efdf5117.tar.xz |
replace async client API / federator msg processing with worker pools (#497)
* replace async client API / federator msg processing with worker pools
* appease our lord-and-saviour, the linter
Diffstat (limited to 'internal/processing/status/status.go')
-rw-r--r-- | internal/processing/status/status.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/internal/processing/status/status.go b/internal/processing/status/status.go index 421ab5bbe..207bffb30 100644 --- a/internal/processing/status/status.go +++ b/internal/processing/status/status.go @@ -29,6 +29,7 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/text" "github.com/superseriousbusiness/gotosocial/internal/typeutils" "github.com/superseriousbusiness/gotosocial/internal/visibility" + "github.com/superseriousbusiness/gotosocial/internal/worker" ) // Processor wraps a bunch of functions for processing statuses. @@ -69,22 +70,22 @@ type Processor interface { } type processor struct { - tc typeutils.TypeConverter - db db.DB - filter visibility.Filter - formatter text.Formatter - fromClientAPI chan messages.FromClientAPI - parseMention gtsmodel.ParseMentionFunc + tc typeutils.TypeConverter + db db.DB + filter visibility.Filter + formatter text.Formatter + clientWorker *worker.Worker[messages.FromClientAPI] + parseMention gtsmodel.ParseMentionFunc } // New returns a new status processor. -func New(db db.DB, tc typeutils.TypeConverter, fromClientAPI chan messages.FromClientAPI, parseMention gtsmodel.ParseMentionFunc) Processor { +func New(db db.DB, tc typeutils.TypeConverter, clientWorker *worker.Worker[messages.FromClientAPI], parseMention gtsmodel.ParseMentionFunc) Processor { return &processor{ - tc: tc, - db: db, - filter: visibility.NewFilter(db), - formatter: text.NewFormatter(db), - fromClientAPI: fromClientAPI, - parseMention: parseMention, + tc: tc, + db: db, + filter: visibility.NewFilter(db), + formatter: text.NewFormatter(db), + clientWorker: clientWorker, + parseMention: parseMention, } } |