Crates.io | async-subscription-map |
lib.rs | async-subscription-map |
version | 0.1.0 |
source | src |
created_at | 2022-08-19 15:19:38.076544 |
updated_at | 2022-08-19 15:19:38.076544 |
description | Async bookkeeping datastructure for state subscriptions |
homepage | |
repository | https://github.com/Hum-Systems/async-subscription-map |
max_upload_size | |
id | 648755 |
size | 77,865 |
A subscription map is a self cleaning map of Observable
s which tracks tasks
that want to subscribe to state updates on a certain key. This becomes very
useful if you have multiple tasks in your program and you want to wait in one
task until the other starts publishing state updates.
It enables you to generically communicate through your whole program by just knowing an identifier, no need to pass observables around - they are created on the fly and only if someone subscribes to them. This is ideal for highly asynchronous and performance critical backend implementations which serve data accross multiple channels and want to cut down latency through communicating in memory.
The subscription map is selfcleaing in the sense that it removes every subscription entry and its data as soon as no one subscribes to it and thus actively preventing memory leaks!
This project is build ontop of async-observable, take a look at it to understand the underlying synchronization api.