public ServiceBase(TaskScheduler taskScheduler = null) { _scheduler = taskScheduler ?? TaskScheduler.Default; _runner = _scheduler.ToContextRunner(); _initLazy = new AsyncLazyInit(_init); _shutDownLazy = new AsyncLazyInit(_shutDown); }
public ContextAction(AsyncContextRunner contextRunner, object owner, Action <T> action) : this(contextRunner, action.ToWeak(owner)) { }
public ContextAction(AsyncContextRunner contextRunner, WeakAction <T> wa) { WeakAction = wa; ContextRunner = contextRunner; }
public ContextFunc(AsyncContextRunner contextRunner, object owner, Func <TResult> action) : this(contextRunner, action.ToWeak(owner)) { }
public ContextFunc(AsyncContextRunner contextRunner, WeakFunc <TResult> wa) { WeakFunc = wa; ContextRunner = contextRunner; }
public ContextMulticastAction Add(WeakAction wa, AsyncContextRunner runner) { return(new ContextMulticastAction(_actions.Concat(wa.InContext(runner)))); }
public ContextMulticastFuncTask <T> Add(AsyncContextRunner runner, WeakFunc <T, Task> wa) { return(new ContextMulticastFuncTask <T>(_actions.Concat(wa.InContext(runner)))); }
public static ContextAction <T1, T2> InContext <T1, T2>(this Action <T1, T2> a, object owner, AsyncContextRunner context) { return(new ContextAction <T1, T2>(context, owner, a)); }
public static AsyncContextRunner ToContextRunner(this TaskScheduler scheduler) { return(AsyncContextRunner.For(scheduler)); }
public static ContextAction <T1, T2> InContext <T1, T2>(this WeakAction <T1, T2> wa, AsyncContextRunner context) { return(new ContextAction <T1, T2>(context, wa)); }
public static ContextAction InContext(this Action a, object owner, AsyncContextRunner context) { return(new ContextAction(context, owner, a)); }
public static ContextFunc <T, TRes> InContext <T, TRes>(this Func <T, TRes> a, AsyncContextRunner context, object owner) { return(new ContextFunc <T, TRes>(context, owner, a)); }
public static ContextFunc <T, TRes> InContext <T, TRes>(this WeakFunc <T, TRes> wa, AsyncContextRunner context) { return(new ContextFunc <T, TRes>(context, wa)); }
public static ContextAction InContext(this WeakAction wa, AsyncContextRunner context) { return(new ContextAction(context, wa)); }