Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Caching Docs #147

Open
aidanm3341 opened this issue Dec 6, 2024 · 0 comments
Open

Improve Caching Docs #147

aidanm3341 opened this issue Dec 6, 2024 · 0 comments

Comments

@aidanm3341
Copy link
Member

The caching docs should include more information, especially around the effects of channel disposal on any cached messages.

e.g.
This is how caching works:

const broker = messagebroker<IChannels>();
broker.create('channel', { replayCacheSize: 2 }).publish('Jupiter');
broker.get('channel').subscribe(message => console.log(message));
// expect: Jupiter

If you were to dispose of that channel before subscribing, then it behaves like this:

const broker = messagebroker<IChannels>();
broker.create('channel', { replayCacheSize: 2 }).publish('Jupiter');
broker.dispose('channel');
broker.get('channel').subscribe(message => console.log(message));
// expect: nothing...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant