コード例 #1
0
async def test_round_robin_group_router_routees_can_be_removed():
    router, routee1, routee2, routee3 = create_router_with3_routees()

    await context.send(router, RemoveRoutee(routee1))

    routees = await context.request_async(router, GetRoutees(), timeout)
    assert routee1 not in routees.pids
    assert routee2 in routees.pids
    assert routee3 in routees.pids
コード例 #2
0
async def test_round_robin_group_router_routees_can_be_added():
    router, routee1, routee2, routee3 = create_router_with3_routees()
    routee4 = context.spawn(my_actor_props)
    await context.send(router, AddRoutee(routee4))

    routees = await context.request_async(router, GetRoutees(), timeout)
    assert routee1 in routees.pids
    assert routee2 in routees.pids
    assert routee3 in routees.pids
    assert routee4 in routees.pids
コード例 #3
0
async def test_consistent_hash_group_router_routees_can_be_removed():
    router, routee1, routee2, routee3 = create_broadcast_group_router_with3_routees(
    )

    await context.send(router, RemoveRoutee(routee1))
    routees = await context.request_future(router, GetRoutees(), timeout)

    assert routee1 not in routees.pids
    assert routee2 in routees.pids
    assert routee3 in routees.pids
コード例 #4
0
async def test_consistent_hash_group_router_routees_can_be_added():
    router, routee1, routee2, routee3 = create_broadcast_group_router_with3_routees(
    )
    routee4 = context.spawn(my_actor_props)
    await context.send(router, AddRoutee(routee4))

    routees = await context.request_future(router, GetRoutees(), timeout)

    assert routee1 in routees.pids
    assert routee2 in routees.pids
    assert routee3 in routees.pids
    assert routee4 in routees.pids