dotnet / dotnet/reactive

Support for passing objects by ref to OnNext

Open
#1,814 7 comments 0 reactions 0 assignees View on GitHub
[area] Rx feature request
Dominant language
C#
Stars
7.2k
Forks
798
PR merge metrics
No merged PRs in 30d

Description

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` and `IRefObserver/IRefObservable` using `public delegate void RefAction(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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.