Exemplo n.º 1
0
def test_module_fanout():

    actor_config = ActorConfig('fanout', 100, 1, {}, "", disable_exception_handling=True)
    fanout = Fanout(actor_config)
    fanout.pool.queue.inbox.disableFallThrough()

    fanout.pool.createQueue("one")
    fanout.pool.queue.one.disableFallThrough()

    fanout.pool.createQueue("two")
    fanout.pool.queue.two.disableFallThrough()

    fanout.start()

    e = Event(["hello"])

    fanout.pool.queue.inbox.put(e)
    one = getter(fanout.pool.queue.one)
    two = getter(fanout.pool.queue.two)

    fanout.stop()

    assert one.get() == ["hello"]
    assert two.get() == ["hello"]
    assert id(one.get()) != id(two.get())
Exemplo n.º 2
0
def test_module_fanout():

    actor_config = ActorConfig('fanout', 100, 1, {})
    fanout = Fanout(actor_config, deep_copy=True)
    fanout.pool.queue.inbox.disableFallThrough()

    fanout.pool.createQueue("one")
    fanout.pool.queue.one.disableFallThrough()

    fanout.pool.createQueue("two")
    fanout.pool.queue.two.disableFallThrough()

    fanout.start()

    e = Event('test')
    e.setData("hello")

    fanout.pool.queue.inbox.put(e)
    one = getter(fanout.pool.queue.one)
    two = getter(fanout.pool.queue.two)

    fanout.stop()

    assert one.raw()["test"]["data"] == "hello"
    assert two.raw()["test"]["data"] == "hello"
    assert id(one) != id(two)
Exemplo n.º 3
0
def test_module_fanout():

    actor_config = ActorConfig('fanout', 100, 1, {}, "")
    fanout = Fanout(actor_config)
    fanout.pool.queue.inbox.disableFallThrough()

    fanout.pool.createQueue("one")
    fanout.pool.queue.one.disableFallThrough()

    fanout.pool.createQueue("two")
    fanout.pool.queue.two.disableFallThrough()

    fanout.start()

    e = Event(["hello"])

    fanout.pool.queue.inbox.put(e)
    one = getter(fanout.pool.queue.one)
    two = getter(fanout.pool.queue.two)

    fanout.stop()

    assert one.get() == ["hello"]
    assert two.get() == ["hello"]
    assert id(one.get()) != id(two.get())