Skip to content

Eager unsubscribe for Observable.using? #2492

Closed
@davidmoten

Description

@davidmoten

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions