Module pub_sub

Source
Expand description

Publish–subscribe pattern.

This is a generic implementation for [NUT-17(https://github.com/cashubtc/nuts/blob/main/17.md) with a type agnostic Publish-subscribe manager.

The manager has a method for subscribers to subscribe to events with a generic type that must be converted to a vector of indexes.

Events are also generic that should implement the Indexable trait.

Modules§

index
WS Index

Structs§

SubId
Subscription Id wrapper

Constants§

DEFAULT_CHANNEL_SIZE
Default channel size for subscription buffering
DEFAULT_REMOVE_SIZE
Default size of the remove channel

Traits§

OnNewSubscription
On New Subscription trait