public async Task GetFactoryForFiber_Creates_Actor_Using_The_Provided_Fiber()
        {
            var fiber       = Fiber.CreateMonoThreadedFiber();
            var fiberThread = await fiber.Enqueue(() => Thread.CurrentThread);

            var factory = _ActorFactoryBuilder.GetFactoryForFiber(fiber);

            var target = new DummyClass();
            var actor  = factory.Build <IDummyInterface2>(target);
            await actor.DoAsync();

            target.CallingThread.Should().Be(fiberThread);

            await fiber.DisposeAsync();
        }
Пример #2
0
 public void CreateMonoThreadedFiber_Returns_MonoThreadedFiber()
 {
     _Fiber = Fiber.CreateMonoThreadedFiber();
     _Fiber.Should().BeAssignableTo <MonoThreadedFiber>();
 }
Пример #3
0
 public ICancellableDispatcher GetDispatcher() => Fiber.CreateMonoThreadedFiber(_OnCreate);
 public SharedThreadFiberManager(Action <Thread> onCreate = null)
 {
     _Fiber = Fiber.CreateMonoThreadedFiber(onCreate);
 }
 public DispatcherExtensionTest()
 {
     _Fiber = Fiber.CreateMonoThreadedFiber();
 }