Ejemplo n.º 1
0
 //TODO:  add Queue
 /// <summary>
 /// Helper to create and start an IFiber by type
 /// </summary>
 /// <param name="type"></param>
 /// <param name="executor"></param>
 /// <returns></returns>
 public static IFiber StartNew(FiberType type, IExecutor executor = null)
 {
     if (executor == null) executor = new Executor();
     IFiber fiber = GetFromTyoe(type, executor);
     fiber.Start();
     return fiber;
 }
Ejemplo n.º 2
0
 public DispatcherFiber(Executor executor, Dispatcher dispatcher, DispatcherPriority priority = DispatcherPriority.Normal)
     : base(executor, new DispatcherAdapter(dispatcher, priority))
 {
 }
Ejemplo n.º 3
0
 protected override void InternalEnqueue(Action action) =>
 //There is no lock here to force sequentiality, since that will cause deadlocks in some
 //situations.  Stub fibers are not thread safe.
 Executor.Execute(action);