Пример #1
0
        public static FSharpAsync <T> ObserveOnCurrentDispatcher <T>(this FSharpAsync <T> comp)
        {
            var synCtx = SynchronizationContext.Current;

            if (synCtx == null)
            {
                synCtx = new TrampolineSynCtx();
            }
            var scheduler = new SynchronizationContextScheduler(synCtx);

            return(comp.ObserveOn(scheduler));
        }