Skip to content

Overhaul stats: Use broadcast channel for events in HTTP Core #1388

@josecelano

Description

@josecelano

Switch from mpsc to broadcast channel. That will allow multiple event listeners.

  • mpsc: multi-producer, single-consumer channel. Many values can be sent.
  • broadcast: multi-producer, multi-consumer. Many values can be sent. Each receiver sees every value.

It will make the code a little bit more complex becuase we have to handle "Lagging" but evens with one one subscriber are not very useful. They are limited for collecting global metrics or do other stuff but in a centralized way. Multiple listeners allows decoupling logic associated to events.

cc @da2ce7

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions