API Reference dispenser v0.1.1

Modules

A AssignmentStrategy is strategy to handle assigning events to subscribers to meet their demands.

The Even AssignmentStrategy assigns events to as many subscribers as possible, up to their demand. Once a subscribers has its demand satisfied, it is removed from the assignment rounds and the remaining events are assigned to the remaining subscribers. This assignment cycle continues until either all demand is satisfied or all events have been assigned.

The Greedy AssignmentStrategy assigns events to subscribers filling their demand before considering other subscribers. On each call to assign, the order of subscribers is shuffled, meaning that in the long run all of the subscribers will get a roughly equal amount of work, but in the short run, work is assigned in a more bursty fashion.

A Dispenser.Buffer is a buffer that manages incoming events and demand for those events.

Tracks the demands of subscribers.

A MonitoredBuffer contains most of the logic required to implement a GenServer that wraps a Buffer. MonitoredBuffer combines a Buffer to track events and a SubscriptionManager to track subscribers.

A BatchingBufferServer is an example GenServer that uses Dispenser.Buffer. It can receive events and send them to subscriber processes.

A BufferServer is an example GenServer that uses Dispenser.Buffer. It can receive events and send them to subscriber processes.

SubscriptionManager handles monitoring and demonitoring subscribers