//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; }
public DispatcherFiber(Executor executor, Dispatcher dispatcher, DispatcherPriority priority = DispatcherPriority.Normal) : base(executor, new DispatcherAdapter(dispatcher, priority)) { }
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);