summaryrefslogtreecommitdiff
path: root/internal/processing/account/account.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2022-04-28 13:23:11 +0100
committerLibravatar GitHub <noreply@github.com>2022-04-28 13:23:11 +0100
commit420e2fb22bc7aa4967ddadb11e444079efdf5117 (patch)
tree413842c5df646c30a8079671ade5e677e3825fb8 /internal/processing/account/account.go
parent[bugfix] Fix possible race condition in federatingdb (#490) (diff)
downloadgotosocial-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/account/account.go')
-rw-r--r--internal/processing/account/account.go39
1 files changed, 20 insertions, 19 deletions
diff --git a/internal/processing/account/account.go b/internal/processing/account/account.go
index 2a9e5f898..c49df1a1a 100644
--- a/internal/processing/account/account.go
+++ b/internal/processing/account/account.go
@@ -33,6 +33,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"
"github.com/superseriousbusiness/oauth2/v4"
)
@@ -81,28 +82,28 @@ type Processor interface {
}
type processor struct {
- tc typeutils.TypeConverter
- mediaManager media.Manager
- fromClientAPI chan messages.FromClientAPI
- oauthServer oauth.Server
- filter visibility.Filter
- formatter text.Formatter
- db db.DB
- federator federation.Federator
- parseMention gtsmodel.ParseMentionFunc
+ tc typeutils.TypeConverter
+ mediaManager media.Manager
+ clientWorker *worker.Worker[messages.FromClientAPI]
+ oauthServer oauth.Server
+ filter visibility.Filter
+ formatter text.Formatter
+ db db.DB
+ federator federation.Federator
+ parseMention gtsmodel.ParseMentionFunc
}
// New returns a new account processor.
-func New(db db.DB, tc typeutils.TypeConverter, mediaManager media.Manager, oauthServer oauth.Server, fromClientAPI chan messages.FromClientAPI, federator federation.Federator, parseMention gtsmodel.ParseMentionFunc) Processor {
+func New(db db.DB, tc typeutils.TypeConverter, mediaManager media.Manager, oauthServer oauth.Server, clientWorker *worker.Worker[messages.FromClientAPI], federator federation.Federator, parseMention gtsmodel.ParseMentionFunc) Processor {
return &processor{
- tc: tc,
- mediaManager: mediaManager,
- fromClientAPI: fromClientAPI,
- oauthServer: oauthServer,
- filter: visibility.NewFilter(db),
- formatter: text.NewFormatter(db),
- db: db,
- federator: federator,
- parseMention: parseMention,
+ tc: tc,
+ mediaManager: mediaManager,
+ clientWorker: clientWorker,
+ oauthServer: oauthServer,
+ filter: visibility.NewFilter(db),
+ formatter: text.NewFormatter(db),
+ db: db,
+ federator: federator,
+ parseMention: parseMention,
}
}