mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Per-room consumers (#2293)
* Roomserver input refactoring — again! * Ensure the actor runs again * Preserve consumer after unsubscribe * Another sprinkling of magic * Rename `TopicFor` to `Prefixed` * Recreate the stream if the config is bad * Check streams too * Prefix subjects, preserve inboxes * Recreate if subjects wrong * Remove stream subject * Reconstruct properly * Fix mutex unlock * Comments * Fix tests * Don't drop events * Review comments * Separate `queueInputRoomEvents` function * Re-jig control flow a bit
This commit is contained in:
parent
9572f5ed19
commit
98a5e410d7
23 changed files with 345 additions and 152 deletions
|
@ -47,7 +47,7 @@ func NewOutputReadUpdateConsumer(
|
|||
db: store,
|
||||
ServerName: cfg.Matrix.ServerName,
|
||||
durable: cfg.Matrix.JetStream.Durable("UserAPISyncAPIReadUpdateConsumer"),
|
||||
topic: cfg.Matrix.JetStream.TopicFor(jetstream.OutputReadUpdate),
|
||||
topic: cfg.Matrix.JetStream.Prefixed(jetstream.OutputReadUpdate),
|
||||
pgClient: pgClient,
|
||||
userAPI: userAPI,
|
||||
syncProducer: syncProducer,
|
||||
|
|
|
@ -54,7 +54,7 @@ func NewOutputStreamEventConsumer(
|
|||
jetstream: js,
|
||||
db: store,
|
||||
durable: cfg.Matrix.JetStream.Durable("UserAPISyncAPIStreamEventConsumer"),
|
||||
topic: cfg.Matrix.JetStream.TopicFor(jetstream.OutputStreamEvent),
|
||||
topic: cfg.Matrix.JetStream.Prefixed(jetstream.OutputStreamEvent),
|
||||
pgClient: pgClient,
|
||||
userAPI: userAPI,
|
||||
rsAPI: rsAPI,
|
||||
|
|
|
@ -54,8 +54,8 @@ func NewInternalAPI(
|
|||
// it's handled by clientapi, and hence uses its topic. When user
|
||||
// API handles it for all account data, we can remove it from
|
||||
// here.
|
||||
cfg.Matrix.JetStream.TopicFor(jetstream.OutputClientData),
|
||||
cfg.Matrix.JetStream.TopicFor(jetstream.OutputNotificationData),
|
||||
cfg.Matrix.JetStream.Prefixed(jetstream.OutputClientData),
|
||||
cfg.Matrix.JetStream.Prefixed(jetstream.OutputNotificationData),
|
||||
)
|
||||
|
||||
userAPI := &internal.UserInternalAPI{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue