Pas de Map...
... ni de FlatMap
from quote in quotes
where quote.Symbol == "MSFT"
select quote;
from market in markets
from quote in market.quotes
where quote.Symbol == "MSFT"
select quote;
from start in mouseDown
join move in mouseMove
on mouseUp equals Observable.Empty<Unit>() into moveGroup
'event' .NET
Anciennes API async APM
Task,
et IEnumerable
var obs = Read().ToObservable();
IEnumerable<string> Read() {
while (true)
yield return Console.ReadLine();
}
await myObservable;
ImmediateScheduler
CurrentThreadScheduler
TaskPoolScheduler
EventLoopScheduler FTW
ObserveOn ?
SubscribeOn ?
Observable.Range(1, 10)
.ObserveOn(Scheduler.TaskPool)
.Subscribe(
x =>
{
Thread.Sleep(1000 - (100 * x));
Console.Out.WriteLine( x
+ " in thread "
+ Thread.CurrentThread.ManagedThreadId);
}
);
1 in thread 8
2 in thread 9
3 in thread 8
4 in thread 8
5 in thread 14
6 in thread 9
7 in thread 13
8 in thread 9
9 in thread 14
10 in thread 9
Observable.Synchronize()