Reputation: 3361
Consider the following scenario:
How can I deal with it? I thought to use with "Observable.Amb" (after the "A"), but would have to create a subscription in all time manually, and that could complicate in time to stop or release the resources.
Upvotes: 0
Views: 112
Reputation: 39182
Amb
is indeed a good option:
var bSignal = bSource.Select(b => true).Take(1);
var timeoutSignal = Observable.Timer(TimeSpan.FromSeconds(2)).Select(t => false);
var resultSignal = Observable.Amb(bSignal, timeoutSignal);
var result = aSource.Select(a => resultSignal).Switch();
Upvotes: 1