Exemple #1
0
        Awaiter <Option <T> > GetAwaiterOptional()
        {
            // todo assert awaiterScope is empty
            // todo assert awaiterScope will not be used (no subscribes)
            var aw = new Awaiter(_awaitersScope, Dispose.Dispose);

            return(new Awaiter <Option <T> >(aw, () => _result));
        }
Exemple #2
0
        public static Awaiter GetAwaiter(this ISubscribe s)
        {
            var d1 = React.Scope(out var scope);
            var aw = new Awaiter(scope, d1.Dispose);

            s.Subscribe(d1.Dispose, scope);
            return(aw);
        }
Exemple #3
0
        public static Awaiter <T> GetAwaiter <T>(this ISubscribe <T> s)
        {
            var result = new Option <T>();
            var d1     = React.Scope(out var scope);
            var aw     = new Awaiter(scope, d1.Dispose);
            var res    = new Awaiter <T>(aw, () => result.GetOrFail());

            s.Subscribe(msg =>
            {
                result = msg;
                d1.Dispose();
            }, scope);
            return(res);
        }
Exemple #4
0
        public Awaiter GetAwaiter()
        {
            var res = new Awaiter(_awaitersScope, Dispose);

            return(res);
        }
Exemple #5
0
 public Optional(Awaiter <Option <T> > aw, IDisposable disposable, IScope scope)
 {
     _aw         = aw;
     _disposable = disposable;
     _scope      = scope;
 }
Exemple #6
0
        public Awaiter <T> GetAwaiter()
        {
            var aw = new Awaiter(_awaitersScope, Dispose.Dispose);

            return(new Awaiter <T>(aw, () => _result.GetOrFail()));
        }