@@ -51,15 +51,22 @@ def __init__(
5151 """Create a replayer to replay workflows from history.
5252
5353 See :py:meth:`temporalio.worker.Worker.__init__` for a description of
54- most of the arguments. The same arguments need to be passed to the
55- replayer that were passed to the worker when the workflow originally
54+ most of the arguments. Most of the same arguments need to be passed to
55+ the replayer that were passed to the worker when the workflow originally
5656 ran.
57+
58+ Note, unlike the worker, for the replayer the workflow_task_executor
59+ will default to a new thread pool executor with no max_workers set that
60+ will be shared across all replay calls and never explicitly shut down.
61+ Users are encouraged to provide their own if needing more control.
5762 """
5863 if not workflows :
5964 raise ValueError ("At least one workflow must be specified" )
6065 self ._config = ReplayerConfig (
6166 workflows = list (workflows ),
62- workflow_task_executor = workflow_task_executor ,
67+ workflow_task_executor = (
68+ workflow_task_executor or concurrent .futures .ThreadPoolExecutor ()
69+ ),
6370 workflow_runner = workflow_runner ,
6471 unsandboxed_workflow_runner = unsandboxed_workflow_runner ,
6572 namespace = namespace ,
@@ -195,6 +202,7 @@ def on_eviction_hook(
195202 task_queue = task_queue ,
196203 workflows = self ._config ["workflows" ],
197204 workflow_task_executor = self ._config ["workflow_task_executor" ],
205+ max_concurrent_workflow_tasks = 5 ,
198206 workflow_runner = self ._config ["workflow_runner" ],
199207 unsandboxed_workflow_runner = self ._config ["unsandboxed_workflow_runner" ],
200208 data_converter = self ._config ["data_converter" ],
0 commit comments