コード例 #1
0
ファイル: test_module_fanout.py プロジェクト: smetj/wishbone
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())
コード例 #2
0
ファイル: test_module_fanout.py プロジェクト: tf198/wishbone
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)
コード例 #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())