@@ -51,15 +51,22 @@ def __init__(
51
51
"""Create a replayer to replay workflows from history.
52
52
53
53
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
56
56
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.
57
62
"""
58
63
if not workflows :
59
64
raise ValueError ("At least one workflow must be specified" )
60
65
self ._config = ReplayerConfig (
61
66
workflows = list (workflows ),
62
- workflow_task_executor = workflow_task_executor ,
67
+ workflow_task_executor = (
68
+ workflow_task_executor or concurrent .futures .ThreadPoolExecutor ()
69
+ ),
63
70
workflow_runner = workflow_runner ,
64
71
unsandboxed_workflow_runner = unsandboxed_workflow_runner ,
65
72
namespace = namespace ,
@@ -195,6 +202,7 @@ def on_eviction_hook(
195
202
task_queue = task_queue ,
196
203
workflows = self ._config ["workflows" ],
197
204
workflow_task_executor = self ._config ["workflow_task_executor" ],
205
+ max_concurrent_workflow_tasks = 5 ,
198
206
workflow_runner = self ._config ["workflow_runner" ],
199
207
unsandboxed_workflow_runner = self ._config ["unsandboxed_workflow_runner" ],
200
208
data_converter = self ._config ["data_converter" ],
0 commit comments