Fiber implementation backed by a dedicated thread., needs a thread safe queue FiberBase
Inheritance: Fibrous.FiberBase
Esempio n. 1
0
        public static IFiber StartNew(string name)
        {
            var fiber = new ThreadFiber(name);

            fiber.Start();
            return(fiber);
        }
Esempio n. 2
0
        public static IFiber StartNew()
        {
            ThreadFiber pool = new ThreadFiber();

            pool.Start();
            return(pool);
        }
Esempio n. 3
0
        public static IFiber StartNew(IExecutor executor)
        {
            ThreadFiber pool = new ThreadFiber(executor);

            pool.Start();
            return(pool);
        }
Esempio n. 4
0
 public IFiber Build()
 {
     if (_executor == null) _executor = new Executor();
     IFiber fiber;
     switch (_type)
     {
         case FiberType.Thread:
             fiber = new ThreadFiber(_executor, new TimerScheduler(), _queue, _name, true, _priority);
             break;
         case FiberType.Pool:
             fiber = new PoolFiber(_executor);
             break;
         case FiberType.Stub:
             fiber = new StubFiber(_executor);
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
     return fiber;
 }
Esempio n. 5
0
 public static IFiber StartNew(string name)
 {
     var fiber = new ThreadFiber(name);
     fiber.Start();
     return fiber;
 }