summaryrefslogtreecommitdiff
path: root/.forgejo
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-08-26 18:35:54 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-08-26 18:35:54 -0400
commit17c38585fc2623a6b0196146cf6b6df9955ce979 (patch)
tree745729ba55c1b1420181d2885e147aef8eebc913 /.forgejo
parenta2fee1c18d9def1486a570fb3c98db5372c51238 (diff)
Consolidate `events.map(…).collect()` calls into `Broadcaster`.
This conversion, from an iterator of type-specific events (say, `user::Event` or `message::Event`), into a `Vec<event::Event>`, is prevasive, and it needs to be done each time. Having Broadcaster expose a support method for this cuts down on the repetition, at the cost of a slightly alarming amount of type-system nonsense in `broadcast_from`. Historical footnote: the internal message structure is a Vec and not an individual message so that bulk operations, like expiring channels and messages, won't disconnect everyone if they happen to dispatch more than sixteen messages (current queue depth limit) at once. We trade allocation and memory pressure for keeping the connections alive. _Most_ event publishing is an iterator of one item, so the Vec allocation is redundant.
Diffstat (limited to '.forgejo')
0 files changed, 0 insertions, 0 deletions