refactor(gateway): type the housekeeping pool as an Executor
This commit is contained in:
@@ -4339,7 +4339,7 @@ class GatewayRunner(
|
|||||||
return GatewayRunner._get_or_create_pool(
|
return GatewayRunner._get_or_create_pool(
|
||||||
self, "_executor", lambda: _UnboundedThreadExecutor(thread_name_prefix="hermes-gateway"))
|
self, "_executor", lambda: _UnboundedThreadExecutor(thread_name_prefix="hermes-gateway"))
|
||||||
|
|
||||||
def _get_housekeeping_executor(self) -> concurrent.futures.ThreadPoolExecutor:
|
def _get_housekeeping_executor(self) -> concurrent.futures.Executor:
|
||||||
"""Return the gateway-owned executor for best-effort session housekeeping."""
|
"""Return the gateway-owned executor for best-effort session housekeeping."""
|
||||||
return GatewayRunner._get_or_create_pool(
|
return GatewayRunner._get_or_create_pool(
|
||||||
self, "_housekeeping_executor",
|
self, "_housekeeping_executor",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import pytest
|
|||||||
|
|
||||||
from gateway.run import GatewayRunner
|
from gateway.run import GatewayRunner
|
||||||
|
|
||||||
|
|
||||||
def _runner(cleanup=None, *, cleanup_timeout=0.5):
|
def _runner(cleanup=None, *, cleanup_timeout=0.5):
|
||||||
runner = GatewayRunner.__new__(GatewayRunner)
|
runner = GatewayRunner.__new__(GatewayRunner)
|
||||||
runner._executor_lock = threading.Lock()
|
runner._executor_lock = threading.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user