Problem Description
Previous version of kRPC did very little on stream lifetime handling.
It was impossible to ensure, that your application doesn't have any leaks.
Solution
Solution is to introduce two new functions: streamScoped and invokeOnStreamScopeCompletion.
First one creates a "Stream scope" inside which new RPC streams may be created. And when scope is finished - all streams are cancelled. invokeOnStreamScopeCompletion provides a hook to subscribe to a steam scope closure.
Problem Description Previous version of kRPC did very little on stream lifetime handling. It was impossible to ensure, that your application doesn't have any leaks.
Solution Solution is to introduce two new functions:
streamScoped
andinvokeOnStreamScopeCompletion
. First one creates a "Stream scope" inside which new RPC streams may be created. And when scope is finished - all streams are cancelled.invokeOnStreamScopeCompletion
provides a hook to subscribe to a steam scope closure.PR is divided into main 3 parts (by commits):