servicetalk icon indicating copy to clipboard operation
servicetalk copied to clipboard

Introduce a cache for Publishers that tracks subscriptions to manage the cache

Open mgodave opened this issue 1 year ago • 1 comments

Motivation:

Handling the caching of Publishers comes up often and correctly managing the cache can be tricky and error prone to implement correctly. Scenarios where caching of Publishers can be useful include those similar to the multicast and replay operators but have the added dimension of asynchronous access, for instance multiple requests which need to consume the same data.

Modifications:

Add a PublisherCache utility that manages the lifecycle of a cached Publisher. A publisher is removed from the cache when it no longer has any subscriptions.

mgodave avatar Mar 05 '24 20:03 mgodave

Will mark it as draft for now, mark as ready when comments are addressed or close if no plans to continue on this one.

idelpivnitskiy avatar Jan 14 '25 21:01 idelpivnitskiy