Closed
Description
When using Observable.using
to read from a file (a synchronous source) I want to complete the process by writing back to the same file. Because using
doesn't dispose its resource till the downstream is complete I can't perform my secondary action (unless I block or introduce asynchronicity). I'm wondering about creating an Operator
say OperatorUnsubscribeEagerly
that could be chained with the using
command to enable my use case.
For example:
Observable.using(...).toUnsubscribeEagerly().concatWith(...)...
An alternative would be an overload on using
with an additional boolean parameter unsubscribeEagerly
.
What do people think? Perhaps I'm overlooking an existing idiom?