Skip to content

Support for passing objects by ref to OnNext #1814

Open
@ScottKane

Description

@ScottKane

I have recently been using Rx for a simple event bus to publish/subscribe to events throughout my application, the system needed to allow events to be marked as handled and in that case, they wouldn't propagate any further. I realised that with Rx, everything is a copy so there is no way to update the source event.

I created a RefSubject<T> and IRefObserver/IRefObservable using public delegate void RefAction<T>(ref T item) and passing everything by ref which works nicely. The problem is that I would have to implement every operator manually, not so bad right now as I'm only using Where but it would be nice if passing by ref to OnNext was officially supported.

Is there a major reason that it's not in the library right now? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions