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'm learning the ways how to handle observables with this library. This is an example I get a problem with:
using System.Reactive.Linq;using LanguageExt;using LanguageExt.Sys;using LanguageExt.Sys.Live;// Generates numbers from 0 to 4 each 500msvarobs=
Observable.Generate(
initialState:0,
condition:x =>x<5,
iterate:x =>x+1,
resultSelector:x => x,
timeSelector:_ => TimeSpan.FromSeconds(0.5));await obs.Consume(x =>Console<Runtime>.writeLine($"{x}").ToAff()).Run(Runtime.New());
Output: "01234" with a blocked console window, when expected a closed one.
It seems that AutoResetEvent.WaitOne() blocks the thread forever, as there's no onCompleted handler passed when subscribing to the observable.
If it's just me doing something wrong, then I would be glad to be pointed to how to work with observables (specifically, the ones created from C# events to handle them when they are fired).
The text was updated successfully, but these errors were encountered:
I'm learning the ways how to handle observables with this library. This is an example I get a problem with:
Output: "01234" with a blocked console window, when expected a closed one.
It seems that AutoResetEvent.WaitOne() blocks the thread forever, as there's no
onCompleted
handler passed when subscribing to the observable.If it's just me doing something wrong, then I would be glad to be pointed to how to work with observables (specifically, the ones created from C#
event
s to handle them when they are fired).The text was updated successfully, but these errors were encountered: