Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding higher-order overload for Amb #2165

Open
glopesdev opened this issue Aug 30, 2024 · 0 comments
Open

Consider adding higher-order overload for Amb #2165

glopesdev opened this issue Aug 30, 2024 · 0 comments

Comments

@glopesdev
Copy link

glopesdev commented Aug 30, 2024

Feature request

Which next library version (i.e., patch, minor or major)?

minor

What are the platform(s), environment(s) and related component version(s)?

all platforms

Please describe the feature.

Add a higher-order overload to Amb with the following signature:

public static IObservable<TSource> Amb<TSource>(IObservable<IObservable<TSource>> sources)

Amb currently exposes an overload with IEnumerable<IObservable<TSource>> allowing for dynamically evaluated sequences of observables competing to react first, but strangely it does not provide the fully reactive counterpart with IObservable<IObservable<TSource>>.

This would allow for candidate sequences to be computed reactively. The main difference would be not waiting for all sequences to be available before subscribing to candidates. The first sequence to emit a notification would surface all its notifications. All subscriptions to other sequences, including the higher-order sequence, would be cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant