You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had a case where I was building an observable wrapper over a module where OnNext would be guaranteed to be called serially, while OnCompleted/OnError may be called concurrently.
Since I knew OnCompleted/OnError would not be called frequently, I used a SpinLock where the OnNext path would use TryEnter (non-blocking) and the OnComplete/OnError would use Enter (spin-waiting), and this works fine given my situation.
I later went digging through the Rx.NET source and found this absolute gem by the name of HalfSerializer which is exactly what I needed for my use case! The implementation is very elegant and completely non-blocking. 🤩
Would it be possible to expose a thin wrapper around it that allows me to pass in an IObserver<T> rather than ISink<T>?
The text was updated successfully, but these errors were encountered:
I recently had a case where I was building an observable wrapper over a module where
OnNext
would be guaranteed to be called serially, whileOnCompleted/OnError
may be called concurrently.Since I knew
OnCompleted/OnError
would not be called frequently, I used aSpinLock
where theOnNext
path would useTryEnter
(non-blocking) and theOnComplete/OnError
would useEnter
(spin-waiting), and this works fine given my situation.I later went digging through the Rx.NET source and found this absolute gem by the name of
HalfSerializer
which is exactly what I needed for my use case! The implementation is very elegant and completely non-blocking. 🤩Would it be possible to expose a thin wrapper around it that allows me to pass in an
IObserver<T>
rather thanISink<T>
?The text was updated successfully, but these errors were encountered: