add callback timeouts, secondary thread pools, and frame directives to Router

This commit is contained in:
2024-05-14 06:37:08 -07:00
parent 52ff2622f3
commit aab101bd1c
6 changed files with 552 additions and 112 deletions

View File

@@ -1,6 +1,7 @@
import logging
from pathlib import Path
from functools import partial
from concurrent.futures import wait
from execlog import util
from execlog import ChainRouter, Event
@@ -41,7 +42,7 @@ def test_single_router_submission():
Event(endpoint='endpoint_proxy', name='file3'),
]
futures = router2.submit(events)
router2.wait_on_futures(futures)
wait(futures)
assert True
@@ -52,7 +53,7 @@ def test_chain_router_submission():
Event(endpoint='endpoint_proxy', name='file3'),
]
futures = chain_router.submit(events)
chain_router.wait_on_futures(futures)
wait(futures)
assert True

View File

@@ -94,7 +94,8 @@ def test_server_with_listeners():
server.shutdown()
thread.join()
# finally check the router event logs
assert router1.event_log[0][1] == ['router1 job success']
assert router2.event_log[0][1] == ['router2 job success']
# finally check the router event logs: holds tier-I futures, which hold lists of
# tier-II futures
assert [r.result() for r in router1.event_log[0][1].result()] == ['router1 job success']
assert [r.result() for r in router2.event_log[0][1].result()] == ['router2 job success']