3
如果我做了以下內容:有沒有「熱」相當於Observable.Interval
var obs =
Observable
.Interval(TimeSpan.FromSeconds(1))
.Select(x => "A" + x.ToString());
obs
.Subscribe(x => Console.WriteLine("From first: " + x.ToString()));
Observable
.Timer(TimeSpan.FromSeconds(3))
.SelectMany(_ => obs)
.Subscribe(x => Console.WriteLine("From second: " + x.ToString()));
4秒鐘後,我會得到這樣的:
From first: A0
From first: A1
From first: A2
From second: A0
From first: A3
是否有相當於一個「熱」使用發佈()和connect()會變成你的冷觀察到的熱
From first: A0
From first: A1
From first: A2
From second: A3
From first: A3