@@ -107,8 +107,8 @@ def __init__(
107
107
* ,
108
108
task_queue : str ,
109
109
activities : Sequence [Callable ] = [],
110
- workflows : Sequence [Type ] = [],
111
110
nexus_services : Sequence [Any ] = [],
111
+ workflows : Sequence [Type ] = [],
112
112
activity_executor : Optional [concurrent .futures .Executor ] = None ,
113
113
workflow_task_executor : Optional [concurrent .futures .ThreadPoolExecutor ] = None ,
114
114
workflow_runner : WorkflowRunner = SandboxedWorkflowRunner (),
@@ -158,10 +158,10 @@ def __init__(
158
158
activities: Activity callables decorated with
159
159
:py:func:`@activity.defn<temporalio.activity.defn>`. Activities
160
160
may be async functions or non-async functions.
161
- workflows: Workflow classes decorated with
162
- :py:func:`@workflow.defn<temporalio.workflow.defn>`.
163
161
nexus_services: Nexus service instances decorated with
164
162
:py:func:`@nexusrpc.handler.service<nexusrpc.handler.service>`.
163
+ workflows: Workflow classes decorated with
164
+ :py:func:`@workflow.defn<temporalio.workflow.defn>`.
165
165
activity_executor: Concurrent executor to use for non-async
166
166
activities. This is required if any activities are non-async.
167
167
:py:class:`concurrent.futures.ThreadPoolExecutor` is
@@ -396,6 +396,17 @@ def __init__(
396
396
interceptors = interceptors ,
397
397
metric_meter = self ._runtime .metric_meter ,
398
398
)
399
+ self ._nexus_worker : Optional [_NexusWorker ] = None
400
+ if nexus_services :
401
+ self ._nexus_worker = _NexusWorker (
402
+ bridge_worker = lambda : self ._bridge_worker ,
403
+ client = client ,
404
+ task_queue = task_queue ,
405
+ nexus_services = nexus_services ,
406
+ data_converter = client_config ["data_converter" ],
407
+ interceptors = interceptors ,
408
+ metric_meter = self ._runtime .metric_meter ,
409
+ )
399
410
self ._workflow_worker : Optional [_WorkflowWorker ] = None
400
411
if workflows :
401
412
should_enforce_versioning_behavior = (
@@ -424,18 +435,6 @@ def __init__(
424
435
should_enforce_versioning_behavior = should_enforce_versioning_behavior ,
425
436
)
426
437
427
- self ._nexus_worker : Optional [_NexusWorker ] = None
428
- if nexus_services :
429
- self ._nexus_worker = _NexusWorker (
430
- bridge_worker = lambda : self ._bridge_worker ,
431
- client = client ,
432
- task_queue = task_queue ,
433
- nexus_services = nexus_services ,
434
- data_converter = client_config ["data_converter" ],
435
- interceptors = interceptors ,
436
- metric_meter = self ._runtime .metric_meter ,
437
- )
438
-
439
438
if tuner is not None :
440
439
if (
441
440
max_concurrent_workflow_tasks
0 commit comments