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)); }
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); }
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); }
public Awaiter GetAwaiter() { var res = new Awaiter(_awaitersScope, Dispose); return(res); }
public Optional(Awaiter <Option <T> > aw, IDisposable disposable, IScope scope) { _aw = aw; _disposable = disposable; _scope = scope; }
public Awaiter <T> GetAwaiter() { var aw = new Awaiter(_awaitersScope, Dispose.Dispose); return(new Awaiter <T>(aw, () => _result.GetOrFail())); }