temporalio 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +1469 -659
- data/Cargo.toml +1 -1
- data/Gemfile +9 -5
- data/README.md +59 -3
- data/Rakefile +1 -1
- data/ext/Cargo.toml +9 -3
- data/lib/temporalio/api/activity/v1/message.rb +1 -1
- data/lib/temporalio/api/batch/v1/message.rb +4 -1
- data/lib/temporalio/api/cloud/billing/v1/message.rb +2 -1
- data/lib/temporalio/api/cloud/cloudservice/v1/request_response.rb +17 -1
- data/lib/temporalio/api/cloud/cloudservice/v1/service.rb +1 -1
- data/lib/temporalio/api/cloud/connectivityrule/v1/message.rb +1 -1
- data/lib/temporalio/api/cloud/identity/v1/message.rb +8 -1
- data/lib/temporalio/api/cloud/namespace/v1/message.rb +5 -1
- data/lib/temporalio/api/command/v1/message.rb +3 -1
- data/lib/temporalio/api/common/v1/message.rb +9 -1
- data/lib/temporalio/api/deployment/v1/message.rb +3 -1
- data/lib/temporalio/api/enums/v1/activity.rb +1 -1
- data/lib/temporalio/api/enums/v1/batch_operation.rb +1 -1
- data/lib/temporalio/api/enums/v1/common.rb +2 -1
- data/lib/temporalio/api/enums/v1/failed_cause.rb +1 -1
- data/lib/temporalio/api/enums/v1/time_skipping.rb +21 -0
- data/lib/temporalio/api/errordetails/v1/message.rb +2 -1
- data/lib/temporalio/api/history/v1/message.rb +3 -1
- data/lib/temporalio/api/namespace/v1/message.rb +1 -1
- data/lib/temporalio/api/nexus/v1/message.rb +1 -1
- data/lib/temporalio/api/nexusannotations/v1/options.rb +20 -0
- data/lib/temporalio/api/payload_visitor.rb +32 -0
- data/lib/temporalio/api/schedule/v1/message.rb +1 -1
- data/lib/temporalio/api/sdk/v1/event_group_marker.rb +26 -0
- data/lib/temporalio/api/taskqueue/v1/message.rb +2 -1
- data/lib/temporalio/api/update/v1/message.rb +1 -1
- data/lib/temporalio/api/worker/v1/message.rb +13 -1
- data/lib/temporalio/api/workflow/v1/message.rb +3 -2
- data/lib/temporalio/api/workflowservice/v1/request_response.rb +14 -1
- data/lib/temporalio/api/workflowservice/v1/service.rb +3 -2
- data/lib/temporalio/client/connection/cloud_service.rb +120 -0
- data/lib/temporalio/client/connection/workflow_service.rb +90 -0
- data/lib/temporalio/client/connection.rb +68 -3
- data/lib/temporalio/client/schedule.rb +4 -5
- data/lib/temporalio/client/workflow_execution.rb +2 -2
- data/lib/temporalio/client/workflow_handle.rb +2 -1
- data/lib/temporalio/client.rb +14 -11
- data/lib/temporalio/converters/data_converter.rb +1 -0
- data/lib/temporalio/converters/failure_converter.rb +7 -4
- data/lib/temporalio/internal/bridge/api/common/common.rb +2 -1
- data/lib/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rb +1 -1
- data/lib/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rb +1 -1
- data/lib/temporalio/internal/bridge/client.rb +8 -1
- data/lib/temporalio/internal/bridge/runtime.rb +4 -1
- data/lib/temporalio/internal/bridge/worker.rb +3 -1
- data/lib/temporalio/internal/bridge.rb +20 -0
- data/lib/temporalio/internal/google_protobuf.rb +11 -0
- data/lib/temporalio/internal/worker/workflow_instance/context.rb +2 -0
- data/lib/temporalio/internal/worker/workflow_instance/details.rb +3 -1
- data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +9 -0
- data/lib/temporalio/internal/worker/workflow_instance/scheduler.rb +73 -2
- data/lib/temporalio/internal/worker/workflow_instance.rb +36 -6
- data/lib/temporalio/internal/worker/workflow_worker.rb +10 -2
- data/lib/temporalio/internal/workflow_task_failure_error.rb +9 -0
- data/lib/temporalio/runtime.rb +25 -7
- data/lib/temporalio/scoped_logger.rb +15 -0
- data/lib/temporalio/version.rb +1 -1
- data/lib/temporalio/worker/activity_executor/fiber.rb +1 -1
- data/lib/temporalio/worker/activity_executor/thread_pool.rb +1 -1
- data/lib/temporalio/worker/illegal_workflow_call_validator.rb +3 -1
- data/lib/temporalio/worker/workflow_executor/thread_pool.rb +5 -1
- data/lib/temporalio/worker/workflow_replayer.rb +19 -4
- data/lib/temporalio/worker.rb +54 -9
- data/lib/temporalio/workflow/future.rb +5 -0
- data/lib/temporalio/workflow/nexus_operation_cancellation_type.rb +4 -2
- data/lib/temporalio/workflow.rb +16 -9
- data/rbi/google/protobuf.rbi +25 -0
- data/rbi/temporalio/activity/cancellation_details.rbi +33 -0
- data/rbi/temporalio/activity/complete_async_error.rbi +3 -0
- data/rbi/temporalio/activity/context.rbi +42 -0
- data/rbi/temporalio/activity/definition.rbi +74 -0
- data/rbi/temporalio/activity/info.rbi +112 -0
- data/rbi/temporalio/activity.rbi +3 -0
- data/rbi/temporalio/api/activity/v1/message.rbi +1539 -0
- data/rbi/temporalio/api/batch/v1/message.rbi +1510 -0
- data/rbi/temporalio/api/callback/v1/message.rbi +188 -0
- data/rbi/temporalio/api/cloud/account/v1/message.rbi +650 -0
- data/rbi/temporalio/api/cloud/auditlog/v1/message.rbi +318 -0
- data/rbi/temporalio/api/cloud/billing/v1/message.rbi +480 -0
- data/rbi/temporalio/api/cloud/cloudservice/v1/request_response.rbi +12454 -0
- data/rbi/temporalio/api/cloud/cloudservice/v1/service.rbi +3 -0
- data/rbi/temporalio/api/cloud/cloudservice/v1/service_services.rbi +709 -0
- data/rbi/temporalio/api/cloud/cloudservice.rbi +5 -0
- data/rbi/temporalio/api/cloud/connectivityrule/v1/message.rbi +403 -0
- data/rbi/temporalio/api/cloud/identity/v1/message.rbi +3072 -0
- data/rbi/temporalio/api/cloud/namespace/v1/message.rbi +3659 -0
- data/rbi/temporalio/api/cloud/nexus/v1/message.rbi +595 -0
- data/rbi/temporalio/api/cloud/operation/v1/message.rbi +244 -0
- data/rbi/temporalio/api/cloud/region/v1/message.rbi +166 -0
- data/rbi/temporalio/api/cloud/resource/v1/message.rbi +29 -0
- data/rbi/temporalio/api/cloud/sink/v1/message.rbi +438 -0
- data/rbi/temporalio/api/cloud/usage/v1/message.rbi +409 -0
- data/rbi/temporalio/api/command/v1/message.rbi +2675 -0
- data/rbi/temporalio/api/common/v1/grpc_status.rbi +92 -0
- data/rbi/temporalio/api/common/v1/message.rbi +3457 -0
- data/rbi/temporalio/api/compute/v1/config.rbi +421 -0
- data/rbi/temporalio/api/compute/v1/provider.rbi +125 -0
- data/rbi/temporalio/api/compute/v1/scaler.rbi +102 -0
- data/rbi/temporalio/api/deployment/v1/message.rbi +2340 -0
- data/rbi/temporalio/api/enums/v1/activity.rbi +63 -0
- data/rbi/temporalio/api/enums/v1/batch_operation.rbi +56 -0
- data/rbi/temporalio/api/enums/v1/command_type.rbi +36 -0
- data/rbi/temporalio/api/enums/v1/common.rbi +199 -0
- data/rbi/temporalio/api/enums/v1/deployment.rbi +80 -0
- data/rbi/temporalio/api/enums/v1/event_type.rbi +79 -0
- data/rbi/temporalio/api/enums/v1/failed_cause.rbi +159 -0
- data/rbi/temporalio/api/enums/v1/namespace.rbi +58 -0
- data/rbi/temporalio/api/enums/v1/nexus.rbi +98 -0
- data/rbi/temporalio/api/enums/v1/query.rbi +40 -0
- data/rbi/temporalio/api/enums/v1/reset.rbi +60 -0
- data/rbi/temporalio/api/enums/v1/schedule.rbi +25 -0
- data/rbi/temporalio/api/enums/v1/task_queue.rbi +134 -0
- data/rbi/temporalio/api/enums/v1/time_skipping.rbi +22 -0
- data/rbi/temporalio/api/enums/v1/update.rbi +39 -0
- data/rbi/temporalio/api/enums/v1/workflow.rbi +259 -0
- data/rbi/temporalio/api/errordetails/v1/message.rbi +1446 -0
- data/rbi/temporalio/api/export/v1/message.rbi +123 -0
- data/rbi/temporalio/api/failure/v1/message.rbi +1303 -0
- data/rbi/temporalio/api/filter/v1/message.rbi +267 -0
- data/rbi/temporalio/api/history/v1/message.rbi +10757 -0
- data/rbi/temporalio/api/namespace/v1/message.rbi +1135 -0
- data/rbi/temporalio/api/nexus/v1/message.rbi +2780 -0
- data/rbi/temporalio/api/nexusannotations/v1/options.rbi +161 -0
- data/rbi/temporalio/api/nexusservices/workerservice/v1/request_response.rbi +124 -0
- data/rbi/temporalio/api/operatorservice/v1/request_response.rbi +1836 -0
- data/rbi/temporalio/api/operatorservice/v1/service.rbi +3 -0
- data/rbi/temporalio/api/operatorservice/v1/service_services.rbi +143 -0
- data/rbi/temporalio/api/operatorservice.rbi +5 -0
- data/rbi/temporalio/api/payload_visitor.rbi +876 -0
- data/rbi/temporalio/api/protoc_gen_openapiv2/options/annotations.rbi +3 -0
- data/rbi/temporalio/api/protoc_gen_openapiv2/options/openapiv2.rbi +3482 -0
- data/rbi/temporalio/api/protocol/v1/message.rbi +139 -0
- data/rbi/temporalio/api/protometa/v1/annotations.rbi +97 -0
- data/rbi/temporalio/api/query/v1/message.rbi +288 -0
- data/rbi/temporalio/api/replication/v1/message.rbi +226 -0
- data/rbi/temporalio/api/rules/v1/message.rbi +492 -0
- data/rbi/temporalio/api/schedule/v1/message.rbi +2377 -0
- data/rbi/temporalio/api/sdk/v1/enhanced_stack_trace.rbi +478 -0
- data/rbi/temporalio/api/sdk/v1/event_group_marker.rbi +337 -0
- data/rbi/temporalio/api/sdk/v1/external_storage.rbi +85 -0
- data/rbi/temporalio/api/sdk/v1/task_complete_metadata.rbi +206 -0
- data/rbi/temporalio/api/sdk/v1/user_metadata.rbi +98 -0
- data/rbi/temporalio/api/sdk/v1/worker_config.rbi +255 -0
- data/rbi/temporalio/api/sdk/v1/workflow_metadata.rbi +297 -0
- data/rbi/temporalio/api/taskqueue/v1/message.rbi +2571 -0
- data/rbi/temporalio/api/testservice/v1/request_response.rbi +380 -0
- data/rbi/temporalio/api/testservice/v1/service.rbi +3 -0
- data/rbi/temporalio/api/testservice/v1/service_services.rbi +100 -0
- data/rbi/temporalio/api/update/v1/message.rbi +800 -0
- data/rbi/temporalio/api/version/v1/message.rbi +281 -0
- data/rbi/temporalio/api/worker/v1/message.rbi +2305 -0
- data/rbi/temporalio/api/workflow/v1/message.rbi +5031 -0
- data/rbi/temporalio/api/workflowservice/v1/request_response.rbi +31061 -0
- data/rbi/temporalio/api/workflowservice/v1/service.rbi +3 -0
- data/rbi/temporalio/api/workflowservice/v1/service_services.rbi +1579 -0
- data/rbi/temporalio/api/workflowservice.rbi +5 -0
- data/rbi/temporalio/api.rbi +7 -0
- data/rbi/temporalio/cancellation.rbi +40 -0
- data/rbi/temporalio/client/activity_execution.rbi +134 -0
- data/rbi/temporalio/client/activity_execution_count.rbi +23 -0
- data/rbi/temporalio/client/activity_execution_status.rbi +11 -0
- data/rbi/temporalio/client/activity_handle.rbi +49 -0
- data/rbi/temporalio/client/activity_id_reference.rbi +24 -0
- data/rbi/temporalio/client/async_activity_handle.rbi +49 -0
- data/rbi/temporalio/client/connection/cloud_service.rbi +239 -0
- data/rbi/temporalio/client/connection/operator_service.rbi +47 -0
- data/rbi/temporalio/client/connection/service.rbi +19 -0
- data/rbi/temporalio/client/connection/test_service.rbi +29 -0
- data/rbi/temporalio/client/connection/workflow_service.rbi +380 -0
- data/rbi/temporalio/client/connection.rbi +286 -0
- data/rbi/temporalio/client/interceptor.rbi +1067 -0
- data/rbi/temporalio/client/pending_activity_state.rbi +9 -0
- data/rbi/temporalio/client/plugin.rbi +17 -0
- data/rbi/temporalio/client/schedule.rbi +677 -0
- data/rbi/temporalio/client/schedule_handle.rbi +40 -0
- data/rbi/temporalio/client/with_start_workflow_operation.rbi +126 -0
- data/rbi/temporalio/client/workflow_execution.rbi +62 -0
- data/rbi/temporalio/client/workflow_execution_count.rbi +23 -0
- data/rbi/temporalio/client/workflow_execution_status.rbi +11 -0
- data/rbi/temporalio/client/workflow_handle.rbi +148 -0
- data/rbi/temporalio/client/workflow_query_reject_condition.rbi +7 -0
- data/rbi/temporalio/client/workflow_update_handle.rbi +38 -0
- data/rbi/temporalio/client/workflow_update_wait_stage.rbi +7 -0
- data/rbi/temporalio/client.rbi +534 -0
- data/rbi/temporalio/common_enums.rbi +45 -0
- data/rbi/temporalio/contrib/open_telemetry.rbi +73 -0
- data/rbi/temporalio/converters/data_converter.rbi +44 -0
- data/rbi/temporalio/converters/failure_converter.rbi +25 -0
- data/rbi/temporalio/converters/payload_codec.rbi +11 -0
- data/rbi/temporalio/converters/payload_converter/binary_null.rbi +5 -0
- data/rbi/temporalio/converters/payload_converter/binary_plain.rbi +5 -0
- data/rbi/temporalio/converters/payload_converter/binary_protobuf.rbi +5 -0
- data/rbi/temporalio/converters/payload_converter/composite.rbi +20 -0
- data/rbi/temporalio/converters/payload_converter/encoding.rbi +14 -0
- data/rbi/temporalio/converters/payload_converter/json_plain.rbi +10 -0
- data/rbi/temporalio/converters/payload_converter/json_protobuf.rbi +5 -0
- data/rbi/temporalio/converters/payload_converter.rbi +28 -0
- data/rbi/temporalio/converters/raw_value.rbi +11 -0
- data/rbi/temporalio/converters.rbi +3 -0
- data/rbi/temporalio/env_config.rbi +156 -0
- data/rbi/temporalio/error/failure.rbi +3 -0
- data/rbi/temporalio/error.rbi +313 -0
- data/rbi/temporalio/internal/bridge/api/activity_result/activity_result.rbi +547 -0
- data/rbi/temporalio/internal/bridge/api/activity_task/activity_task.rbi +705 -0
- data/rbi/temporalio/internal/bridge/api/child_workflow/child_workflow.rbi +332 -0
- data/rbi/temporalio/internal/bridge/api/common/common.rbi +306 -0
- data/rbi/temporalio/internal/bridge/api/core_interface.rbi +567 -0
- data/rbi/temporalio/internal/bridge/api/external_data/external_data.rbi +255 -0
- data/rbi/temporalio/internal/bridge/api/nexus/nexus.rbi +527 -0
- data/rbi/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rbi +2808 -0
- data/rbi/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rbi +3309 -0
- data/rbi/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rbi +312 -0
- data/rbi/temporalio/internal/bridge/api.rbi +3 -0
- data/rbi/temporalio/internal/bridge/client.rbi +346 -0
- data/rbi/temporalio/internal/bridge/runtime.rbi +251 -0
- data/rbi/temporalio/internal/bridge/testing.rbi +109 -0
- data/rbi/temporalio/internal/bridge/worker.rbi +252 -0
- data/rbi/temporalio/internal/bridge.rbi +47 -0
- data/rbi/temporalio/internal/client/implementation.rbi +53 -0
- data/rbi/temporalio/internal/google_protobuf.rbi +8 -0
- data/rbi/temporalio/internal/metric.rbi +55 -0
- data/rbi/temporalio/internal/proto_utils.rbi +148 -0
- data/rbi/temporalio/internal/worker/activity_worker.rbi +108 -0
- data/rbi/temporalio/internal/worker/multi_runner.rbi +175 -0
- data/rbi/temporalio/internal/worker/workflow_instance/child_workflow_handle.rbi +20 -0
- data/rbi/temporalio/internal/worker/workflow_instance/context.rbi +290 -0
- data/rbi/temporalio/internal/worker/workflow_instance/details.rbi +87 -0
- data/rbi/temporalio/internal/worker/workflow_instance/external_workflow_handle.rbi +14 -0
- data/rbi/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rbi +17 -0
- data/rbi/temporalio/internal/worker/workflow_instance/handler_execution.rbi +17 -0
- data/rbi/temporalio/internal/worker/workflow_instance/handler_hash.rbi +24 -0
- data/rbi/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rbi +17 -0
- data/rbi/temporalio/internal/worker/workflow_instance/inbound_implementation.rbi +21 -0
- data/rbi/temporalio/internal/worker/workflow_instance/nexus_client.rbi +47 -0
- data/rbi/temporalio/internal/worker/workflow_instance/nexus_operation_handle.rbi +19 -0
- data/rbi/temporalio/internal/worker/workflow_instance/outbound_implementation.rbi +43 -0
- data/rbi/temporalio/internal/worker/workflow_instance/replay_safe_logger.rbi +11 -0
- data/rbi/temporalio/internal/worker/workflow_instance/replay_safe_metric.rbi +15 -0
- data/rbi/temporalio/internal/worker/workflow_instance/scheduler.rbi +36 -0
- data/rbi/temporalio/internal/worker/workflow_instance.rbi +231 -0
- data/rbi/temporalio/internal/worker/workflow_worker.rbi +199 -0
- data/rbi/temporalio/internal/workflow_task_failure_error.rbi +3 -0
- data/rbi/temporalio/internal.rbi +3 -0
- data/rbi/temporalio/metric.rbi +56 -0
- data/rbi/temporalio/priority.rbi +38 -0
- data/rbi/temporalio/retry_policy.rbi +40 -0
- data/rbi/temporalio/runtime/metric_buffer.rbi +45 -0
- data/rbi/temporalio/runtime.rbi +194 -0
- data/rbi/temporalio/scoped_logger.rbi +50 -0
- data/rbi/temporalio/search_attributes.rbi +94 -0
- data/rbi/temporalio/simple_plugin.rbi +41 -0
- data/rbi/temporalio/testing/activity_environment.rbi +43 -0
- data/rbi/temporalio/testing/workflow_environment.rbi +116 -0
- data/rbi/temporalio/testing.rbi +3 -0
- data/rbi/temporalio/version.rbi +5 -0
- data/rbi/temporalio/versioning_override.rbi +13 -0
- data/rbi/temporalio/worker/activity_executor/fiber.rbi +20 -0
- data/rbi/temporalio/worker/activity_executor/thread_pool.rbi +20 -0
- data/rbi/temporalio/worker/activity_executor.rbi +20 -0
- data/rbi/temporalio/worker/deployment_options.rbi +23 -0
- data/rbi/temporalio/worker/illegal_workflow_call_validator.rbi +33 -0
- data/rbi/temporalio/worker/interceptor.rbi +489 -0
- data/rbi/temporalio/worker/plugin.rbi +49 -0
- data/rbi/temporalio/worker/poller_behavior.rbi +29 -0
- data/rbi/temporalio/worker/thread_pool.rbi +38 -0
- data/rbi/temporalio/worker/tuner.rbi +221 -0
- data/rbi/temporalio/worker/workflow_executor/thread_pool.rbi +15 -0
- data/rbi/temporalio/worker/workflow_executor.rbi +8 -0
- data/rbi/temporalio/worker/workflow_replayer.rbi +152 -0
- data/rbi/temporalio/worker.rbi +265 -0
- data/rbi/temporalio/worker_deployment_version.rbi +29 -0
- data/rbi/temporalio/workflow/activity_cancellation_type.rbi +7 -0
- data/rbi/temporalio/workflow/child_workflow_cancellation_type.rbi +8 -0
- data/rbi/temporalio/workflow/child_workflow_handle.rbi +27 -0
- data/rbi/temporalio/workflow/definition.rbi +305 -0
- data/rbi/temporalio/workflow/external_workflow_handle.rbi +24 -0
- data/rbi/temporalio/workflow/future.rbi +62 -0
- data/rbi/temporalio/workflow/handler_unfinished_policy.rbi +6 -0
- data/rbi/temporalio/workflow/info.rbi +100 -0
- data/rbi/temporalio/workflow/nexus_client.rbi +65 -0
- data/rbi/temporalio/workflow/nexus_operation_cancellation_type.rbi +8 -0
- data/rbi/temporalio/workflow/nexus_operation_handle.rbi +14 -0
- data/rbi/temporalio/workflow/parent_close_policy.rbi +8 -0
- data/rbi/temporalio/workflow/update_info.rbi +14 -0
- data/rbi/temporalio/workflow.rbi +393 -0
- data/rbi/temporalio/workflow_history.rbi +21 -0
- data/rbi/temporalio.rbi +5 -0
- data/sig/common.rbs +1 -0
- data/sig/google/protobuf_compat.rbs +17 -0
- data/sig/open_telemetry.rbs +47 -0
- data/sig/temporalio/activity/cancellation_details.rbs +21 -0
- data/sig/temporalio/activity/complete_async_error.rbs +6 -0
- data/sig/temporalio/activity/context.rbs +26 -0
- data/sig/temporalio/activity/definition.rbs +60 -0
- data/sig/temporalio/activity/info.rbs +57 -0
- data/sig/temporalio/activity.rbs +4 -0
- data/sig/temporalio/api/activity/v1/message.rbs +754 -0
- data/sig/temporalio/api/batch/v1/message.rbs +680 -0
- data/sig/temporalio/api/callback/v1/message.rbs +112 -0
- data/sig/temporalio/api/cloud/account/v1/message.rbs +314 -0
- data/sig/temporalio/api/cloud/auditlog/v1/message.rbs +168 -0
- data/sig/temporalio/api/cloud/billing/v1/message.rbs +279 -0
- data/sig/temporalio/api/cloud/cloudservice/v1/request_response.rbs +4726 -0
- data/sig/temporalio/api/cloud/cloudservice/v1/service.rbs +25 -0
- data/sig/temporalio/api/cloud/cloudservice.rbs +8 -0
- data/sig/temporalio/api/cloud/connectivityrule/v1/message.rbs +191 -0
- data/sig/temporalio/api/cloud/identity/v1/message.rbs +1372 -0
- data/sig/temporalio/api/cloud/namespace/v1/message.rbs +1571 -0
- data/sig/temporalio/api/cloud/nexus/v1/message.rbs +269 -0
- data/sig/temporalio/api/cloud/operation/v1/message.rbs +156 -0
- data/sig/temporalio/api/cloud/region/v1/message.rbs +109 -0
- data/sig/temporalio/api/cloud/resource/v1/message.rbs +61 -0
- data/sig/temporalio/api/cloud/sink/v1/message.rbs +207 -0
- data/sig/temporalio/api/cloud/usage/v1/message.rbs +230 -0
- data/sig/temporalio/api/command/v1/message.rbs +1221 -0
- data/sig/temporalio/api/common/v1/grpc_status.rbs +59 -0
- data/sig/temporalio/api/common/v1/message.rbs +1439 -0
- data/sig/temporalio/api/compute/v1/config.rbs +176 -0
- data/sig/temporalio/api/compute/v1/provider.rbs +73 -0
- data/sig/temporalio/api/compute/v1/scaler.rbs +60 -0
- data/sig/temporalio/api/deployment/v1/message.rbs +1063 -0
- data/sig/temporalio/api/enums/v1/activity.rbs +138 -0
- data/sig/temporalio/api/enums/v1/batch_operation.rbs +110 -0
- data/sig/temporalio/api/enums/v1/command_type.rbs +74 -0
- data/sig/temporalio/api/enums/v1/common.rbs +294 -0
- data/sig/temporalio/api/enums/v1/deployment.rbs +177 -0
- data/sig/temporalio/api/enums/v1/event_type.rbs +263 -0
- data/sig/temporalio/api/enums/v1/failed_cause.rbs +293 -0
- data/sig/temporalio/api/enums/v1/namespace.rbs +87 -0
- data/sig/temporalio/api/enums/v1/nexus.rbs +172 -0
- data/sig/temporalio/api/enums/v1/query.rbs +69 -0
- data/sig/temporalio/api/enums/v1/reset.rbs +106 -0
- data/sig/temporalio/api/enums/v1/schedule.rbs +68 -0
- data/sig/temporalio/api/enums/v1/task_queue.rbs +238 -0
- data/sig/temporalio/api/enums/v1/time_skipping.rbs +58 -0
- data/sig/temporalio/api/enums/v1/update.rbs +87 -0
- data/sig/temporalio/api/enums/v1/workflow.rbs +435 -0
- data/sig/temporalio/api/errordetails/v1/message.rbs +551 -0
- data/sig/temporalio/api/export/v1/message.rbs +63 -0
- data/sig/temporalio/api/failure/v1/message.rbs +579 -0
- data/sig/temporalio/api/filter/v1/message.rbs +121 -0
- data/sig/temporalio/api/history/v1/message.rbs +4938 -0
- data/sig/temporalio/api/namespace/v1/message.rbs +508 -0
- data/sig/temporalio/api/nexus/v1/message.rbs +1268 -0
- data/sig/temporalio/api/nexusannotations/v1/options.rbs +76 -0
- data/sig/temporalio/api/nexusservices/workerservice/v1/request_response.rbs +65 -0
- data/sig/temporalio/api/operatorservice/v1/request_response.rbs +679 -0
- data/sig/temporalio/api/operatorservice/v1/service.rbs +23 -0
- data/sig/temporalio/api/operatorservice.rbs +6 -0
- data/sig/temporalio/api/payload_visitor.rbs +298 -0
- data/sig/temporalio/api/protoc_gen_openapiv2/options/annotations.rbs +23 -0
- data/sig/temporalio/api/protoc_gen_openapiv2/options/openapiv2.rbs +1691 -0
- data/sig/temporalio/api/protocol/v1/message.rbs +90 -0
- data/sig/temporalio/api/protometa/v1/annotations.rbs +62 -0
- data/sig/temporalio/api/query/v1/message.rbs +138 -0
- data/sig/temporalio/api/replication/v1/message.rbs +109 -0
- data/sig/temporalio/api/rules/v1/message.rbs +213 -0
- data/sig/temporalio/api/schedule/v1/message.rbs +1066 -0
- data/sig/temporalio/api/sdk/v1/enhanced_stack_trace.rbs +210 -0
- data/sig/temporalio/api/sdk/v1/event_group_marker.rbs +154 -0
- data/sig/temporalio/api/sdk/v1/external_storage.rbs +54 -0
- data/sig/temporalio/api/sdk/v1/task_complete_metadata.rbs +92 -0
- data/sig/temporalio/api/sdk/v1/user_metadata.rbs +58 -0
- data/sig/temporalio/api/sdk/v1/worker_config.rbs +122 -0
- data/sig/temporalio/api/sdk/v1/workflow_metadata.rbs +138 -0
- data/sig/temporalio/api/taskqueue/v1/message.rbs +1057 -0
- data/sig/temporalio/api/testservice/v1/request_response.rbs +125 -0
- data/sig/temporalio/api/testservice/v1/service.rbs +23 -0
- data/sig/temporalio/api/update/v1/message.rbs +349 -0
- data/sig/temporalio/api/version/v1/message.rbs +143 -0
- data/sig/temporalio/api/worker/v1/message.rbs +1126 -0
- data/sig/temporalio/api/workflow/v1/message.rbs +2332 -0
- data/sig/temporalio/api/workflowservice/v1/request_response.rbs +13006 -0
- data/sig/temporalio/api/workflowservice/v1/service.rbs +23 -0
- data/sig/temporalio/api/workflowservice.rbs +6 -0
- data/sig/temporalio/api.rbs +4 -0
- data/sig/temporalio/cancellation.rbs +20 -0
- data/sig/temporalio/client/activity_execution.rbs +50 -0
- data/sig/temporalio/client/activity_execution_count.rbs +17 -0
- data/sig/temporalio/client/activity_execution_status.rbs +15 -0
- data/sig/temporalio/client/activity_handle.rbs +26 -0
- data/sig/temporalio/client/activity_id_reference.rbs +16 -0
- data/sig/temporalio/client/async_activity_handle.rbs +41 -0
- data/sig/temporalio/client/connection/cloud_service.rbs +315 -0
- data/sig/temporalio/client/connection/operator_service.rbs +59 -0
- data/sig/temporalio/client/connection/service.rbs +17 -0
- data/sig/temporalio/client/connection/test_service.rbs +35 -0
- data/sig/temporalio/client/connection/workflow_service.rbs +503 -0
- data/sig/temporalio/client/connection.rbs +156 -0
- data/sig/temporalio/client/interceptor.rbs +622 -0
- data/sig/temporalio/client/pending_activity_state.rbs +14 -0
- data/sig/temporalio/client/plugin.rbs +14 -0
- data/sig/temporalio/client/schedule.rbs +337 -0
- data/sig/temporalio/client/schedule_handle.rbs +44 -0
- data/sig/temporalio/client/with_start_workflow_operation.rbs +82 -0
- data/sig/temporalio/client/workflow_execution.rbs +37 -0
- data/sig/temporalio/client/workflow_execution_count.rbs +17 -0
- data/sig/temporalio/client/workflow_execution_status.rbs +16 -0
- data/sig/temporalio/client/workflow_handle.rbs +95 -0
- data/sig/temporalio/client/workflow_query_reject_condition.rbs +12 -0
- data/sig/temporalio/client/workflow_update_handle.rbs +26 -0
- data/sig/temporalio/client/workflow_update_wait_stage.rbs +12 -0
- data/sig/temporalio/client.rbs +271 -0
- data/sig/temporalio/common_enums.rbs +60 -0
- data/sig/temporalio/contrib/open_telemetry.rbs +74 -0
- data/sig/temporalio/converters/data_converter.rbs +32 -0
- data/sig/temporalio/converters/failure_converter.rbs +15 -0
- data/sig/temporalio/converters/payload_codec.rbs +8 -0
- data/sig/temporalio/converters/payload_converter/binary_null.rbs +9 -0
- data/sig/temporalio/converters/payload_converter/binary_plain.rbs +9 -0
- data/sig/temporalio/converters/payload_converter/binary_protobuf.rbs +9 -0
- data/sig/temporalio/converters/payload_converter/composite.rbs +16 -0
- data/sig/temporalio/converters/payload_converter/encoding.rbs +13 -0
- data/sig/temporalio/converters/payload_converter/json_plain.rbs +14 -0
- data/sig/temporalio/converters/payload_converter/json_protobuf.rbs +9 -0
- data/sig/temporalio/converters/payload_converter.rbs +24 -0
- data/sig/temporalio/converters/raw_value.rbs +9 -0
- data/sig/temporalio/converters.rbs +4 -0
- data/sig/temporalio/env_config.rbs +86 -0
- data/sig/temporalio/error/failure.rbs +170 -0
- data/sig/temporalio/error.rbs +88 -0
- data/sig/temporalio/internal/bridge/api/activity_result/activity_result.rbs +247 -0
- data/sig/temporalio/internal/bridge/api/activity_task/activity_task.rbs +372 -0
- data/sig/temporalio/internal/bridge/api/child_workflow/child_workflow.rbs +207 -0
- data/sig/temporalio/internal/bridge/api/common/common.rbs +173 -0
- data/sig/temporalio/internal/bridge/api/core_interface.rbs +231 -0
- data/sig/temporalio/internal/bridge/api/external_data/external_data.rbs +134 -0
- data/sig/temporalio/internal/bridge/api/nexus/nexus.rbs +285 -0
- data/sig/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rbs +1304 -0
- data/sig/temporalio/internal/bridge/api/workflow_commands/workflow_commands.rbs +1526 -0
- data/sig/temporalio/internal/bridge/api/workflow_completion/workflow_completion.rbs +156 -0
- data/sig/temporalio/internal/bridge/api.rbs +8 -0
- data/sig/temporalio/internal/bridge/client.rbs +148 -0
- data/sig/temporalio/internal/bridge/metric.rbs +28 -0
- data/sig/temporalio/internal/bridge/runtime.rbs +103 -0
- data/sig/temporalio/internal/bridge/testing.rbs +91 -0
- data/sig/temporalio/internal/bridge/worker.rbs +203 -0
- data/sig/temporalio/internal/bridge.rbs +36 -0
- data/sig/temporalio/internal/client/implementation.rbs +33 -0
- data/sig/temporalio/internal/google_protobuf.rbs +7 -0
- data/sig/temporalio/internal/metric.rbs +35 -0
- data/sig/temporalio/internal/proto_utils.rbs +94 -0
- data/sig/temporalio/internal/worker/activity_worker.rbs +64 -0
- data/sig/temporalio/internal/worker/multi_runner.rbs +132 -0
- data/sig/temporalio/internal/worker/workflow_instance/child_workflow_handle.rbs +22 -0
- data/sig/temporalio/internal/worker/workflow_instance/context.rbs +172 -0
- data/sig/temporalio/internal/worker/workflow_instance/details.rbs +43 -0
- data/sig/temporalio/internal/worker/workflow_instance/external_workflow_handle.rbs +15 -0
- data/sig/temporalio/internal/worker/workflow_instance/externally_immutable_hash.rbs +16 -0
- data/sig/temporalio/internal/worker/workflow_instance/handler_execution.rbs +19 -0
- data/sig/temporalio/internal/worker/workflow_instance/handler_hash.rbs +14 -0
- data/sig/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rbs +20 -0
- data/sig/temporalio/internal/worker/workflow_instance/inbound_implementation.rbs +19 -0
- data/sig/temporalio/internal/worker/workflow_instance/nexus_client.rbs +25 -0
- data/sig/temporalio/internal/worker/workflow_instance/nexus_operation_handle.rbs +19 -0
- data/sig/temporalio/internal/worker/workflow_instance/outbound_implementation.rbs +35 -0
- data/sig/temporalio/internal/worker/workflow_instance/replay_safe_logger.rbs +16 -0
- data/sig/temporalio/internal/worker/workflow_instance/replay_safe_metric.rbs +15 -0
- data/sig/temporalio/internal/worker/workflow_instance/scheduler.rbs +52 -0
- data/sig/temporalio/internal/worker/workflow_instance.rbs +111 -0
- data/sig/temporalio/internal/worker/workflow_worker.rbs +99 -0
- data/sig/temporalio/internal/workflow_task_failure_error.rbs +6 -0
- data/sig/temporalio/internal.rbs +4 -0
- data/sig/temporalio/metric.rbs +55 -0
- data/sig/temporalio/priority.rbs +17 -0
- data/sig/temporalio/retry_policy.rbs +21 -0
- data/sig/temporalio/runtime/metric_buffer.rbs +49 -0
- data/sig/temporalio/runtime.rbs +129 -0
- data/sig/temporalio/scoped_logger.rbs +15 -0
- data/sig/temporalio/search_attributes.rbs +82 -0
- data/sig/temporalio/simple_plugin.rbs +65 -0
- data/sig/temporalio/testing/activity_environment.rbs +52 -0
- data/sig/temporalio/testing/workflow_environment.rbs +141 -0
- data/sig/temporalio/testing.rbs +4 -0
- data/sig/temporalio/version.rbs +3 -0
- data/sig/temporalio/versioning_override.rbs +17 -0
- data/sig/temporalio/worker/activity_executor/fiber.rbs +9 -0
- data/sig/temporalio/worker/activity_executor/thread_pool.rbs +11 -0
- data/sig/temporalio/worker/activity_executor.rbs +12 -0
- data/sig/temporalio/worker/deployment_options.rbs +17 -0
- data/sig/temporalio/worker/illegal_workflow_call_validator.rbs +25 -0
- data/sig/temporalio/worker/interceptor.rbs +373 -0
- data/sig/temporalio/worker/plugin.rbs +47 -0
- data/sig/temporalio/worker/poller_behavior.rbs +23 -0
- data/sig/temporalio/worker/thread_pool.rbs +44 -0
- data/sig/temporalio/worker/tuner.rbs +121 -0
- data/sig/temporalio/worker/workflow_executor/thread_pool.rbs +58 -0
- data/sig/temporalio/worker/workflow_executor.rbs +15 -0
- data/sig/temporalio/worker/workflow_replayer.rbs +105 -0
- data/sig/temporalio/worker.rbs +174 -0
- data/sig/temporalio/worker_deployment_version.rbs +17 -0
- data/sig/temporalio/workflow/activity_cancellation_type.rbs +11 -0
- data/sig/temporalio/workflow/child_workflow_cancellation_type.rbs +12 -0
- data/sig/temporalio/workflow/child_workflow_handle.rbs +18 -0
- data/sig/temporalio/workflow/definition.rbs +181 -0
- data/sig/temporalio/workflow/external_workflow_handle.rbs +17 -0
- data/sig/temporalio/workflow/future.rbs +24 -0
- data/sig/temporalio/workflow/handler_unfinished_policy.rbs +10 -0
- data/sig/temporalio/workflow/info.rbs +79 -0
- data/sig/temporalio/workflow/nexus_client.rbs +34 -0
- data/sig/temporalio/workflow/nexus_operation_cancellation_type.rbs +12 -0
- data/sig/temporalio/workflow/nexus_operation_handle.rbs +10 -0
- data/sig/temporalio/workflow/parent_close_policy.rbs +12 -0
- data/sig/temporalio/workflow/update_info.rbs +15 -0
- data/sig/temporalio/workflow.rbs +215 -0
- data/sig/temporalio/workflow_history.rbs +13 -0
- data/sig/temporalio.rbs +3 -0
- data/temporalio.gemspec +1 -1
- metadata +448 -2
|
@@ -61,7 +61,7 @@ module Temporalio
|
|
|
61
61
|
:current_deployment_version,
|
|
62
62
|
:current_history_length, :current_history_size, :replaying, :random,
|
|
63
63
|
:signal_handlers, :query_handlers, :update_handlers, :context_frozen, :assert_valid_local_activity,
|
|
64
|
-
:in_query_or_validator
|
|
64
|
+
:in_query_or_validator, :random_disabled, :patch_activation_callback
|
|
65
65
|
attr_accessor :io_enabled, :current_details
|
|
66
66
|
|
|
67
67
|
def initialize(details)
|
|
@@ -77,6 +77,7 @@ module Temporalio
|
|
|
77
77
|
@scheduler = Scheduler.new(self)
|
|
78
78
|
@payload_converter = details.payload_converter
|
|
79
79
|
@failure_converter = details.failure_converter
|
|
80
|
+
@patch_activation_callback = details.patch_activation_callback
|
|
80
81
|
@disable_eager_activity_execution = details.disable_eager_activity_execution
|
|
81
82
|
@pending_activities = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
82
83
|
@pending_timers = {} # Keyed by sequence, value is fiber to resume with proto result
|
|
@@ -99,7 +100,9 @@ module Temporalio
|
|
|
99
100
|
@current_history_length = 0
|
|
100
101
|
@current_history_size = 0
|
|
101
102
|
@replaying = false
|
|
103
|
+
@context_frozen = false
|
|
102
104
|
@in_query_or_validator = false
|
|
105
|
+
@random_disabled = false
|
|
103
106
|
@workflow_failure_exception_types = details.workflow_failure_exception_types
|
|
104
107
|
@signal_handlers = HandlerHash.new(
|
|
105
108
|
details.definition.signals,
|
|
@@ -180,7 +183,9 @@ module Temporalio
|
|
|
180
183
|
@commands = []
|
|
181
184
|
@current_activation_error = nil
|
|
182
185
|
@continue_as_new_suggested = activation.continue_as_new_suggested
|
|
183
|
-
@suggest_continue_as_new_reasons = activation.suggest_continue_as_new_reasons.map
|
|
186
|
+
@suggest_continue_as_new_reasons = activation.suggest_continue_as_new_reasons.map do |reason|
|
|
187
|
+
ProtoUtils.enum_to_int(Api::Enums::V1::SuggestContinueAsNewReason, reason)
|
|
188
|
+
end
|
|
184
189
|
@target_worker_deployment_version_changed = activation.target_worker_deployment_version_changed
|
|
185
190
|
@current_deployment_version = WorkerDeploymentVersion._from_bridge(
|
|
186
191
|
activation.deployment_version_for_current_task
|
|
@@ -290,7 +295,12 @@ module Temporalio
|
|
|
290
295
|
patch_id = patch_id.to_s
|
|
291
296
|
@patches_memoized ||= {}
|
|
292
297
|
@patches_memoized.fetch(patch_id) do
|
|
293
|
-
|
|
298
|
+
# Only fresh, non-replay patches can consult rollout policy; replay and deprecation must follow history.
|
|
299
|
+
patched = if deprecated || replaying || @patches_notified.include?(patch_id)
|
|
300
|
+
!replaying || @patches_notified.include?(patch_id)
|
|
301
|
+
else
|
|
302
|
+
patch_activated?(patch_id)
|
|
303
|
+
end
|
|
294
304
|
@patches_memoized[patch_id] = patched
|
|
295
305
|
if patched
|
|
296
306
|
add_command(
|
|
@@ -303,6 +313,20 @@ module Temporalio
|
|
|
303
313
|
end
|
|
304
314
|
end
|
|
305
315
|
|
|
316
|
+
def patch_activated?(patch_id)
|
|
317
|
+
return true unless patch_activation_callback
|
|
318
|
+
|
|
319
|
+
patched = with_context_frozen(in_query_or_validator: false, random_disabled: true) do
|
|
320
|
+
patch_activation_callback.call(Temporalio::Worker::PatchActivationInput.new(
|
|
321
|
+
workflow_info: info,
|
|
322
|
+
patch_id:
|
|
323
|
+
))
|
|
324
|
+
end
|
|
325
|
+
return patched if patched == true || patched == false
|
|
326
|
+
|
|
327
|
+
raise TypeError, 'Patch activation callback must return true or false'
|
|
328
|
+
end
|
|
329
|
+
|
|
306
330
|
def metric_meter
|
|
307
331
|
@metric_meter ||= ReplaySafeMetric::Meter.new(
|
|
308
332
|
@runtime_metric_meter.with_additional_attributes(
|
|
@@ -642,6 +666,7 @@ module Temporalio
|
|
|
642
666
|
hints: err.arg_hints || defn_arg_hints),
|
|
643
667
|
workflow_run_timeout: ProtoUtils.seconds_to_duration(err.run_timeout),
|
|
644
668
|
workflow_task_timeout: ProtoUtils.seconds_to_duration(err.task_timeout),
|
|
669
|
+
backoff_start_interval: ProtoUtils.seconds_to_duration(err.backoff_start_interval),
|
|
645
670
|
memo: ProtoUtils.memo_to_proto_hash(err.memo, payload_converter),
|
|
646
671
|
headers: ProtoUtils.headers_to_proto_hash(err.headers, payload_converter),
|
|
647
672
|
search_attributes: err.search_attributes&._to_proto,
|
|
@@ -683,13 +708,18 @@ module Temporalio
|
|
|
683
708
|
@definition_options.failure_exception_types&.any? { |cls| err.is_a?(cls) }
|
|
684
709
|
end
|
|
685
710
|
|
|
686
|
-
def with_context_frozen(in_query_or_validator:, &)
|
|
711
|
+
def with_context_frozen(in_query_or_validator:, random_disabled: false, &)
|
|
712
|
+
previous_context_frozen = @context_frozen
|
|
713
|
+
previous_in_query_or_validator = @in_query_or_validator
|
|
714
|
+
previous_random_disabled = @random_disabled
|
|
687
715
|
@context_frozen = true
|
|
688
716
|
@in_query_or_validator = in_query_or_validator
|
|
717
|
+
@random_disabled = random_disabled
|
|
689
718
|
yield
|
|
690
719
|
ensure
|
|
691
|
-
@context_frozen =
|
|
692
|
-
@in_query_or_validator =
|
|
720
|
+
@context_frozen = previous_context_frozen
|
|
721
|
+
@in_query_or_validator = previous_in_query_or_validator
|
|
722
|
+
@random_disabled = previous_random_disabled
|
|
693
723
|
end
|
|
694
724
|
|
|
695
725
|
def convert_handler_args(payload_array:, defn:)
|
|
@@ -74,6 +74,7 @@ module Temporalio
|
|
|
74
74
|
workflow_failure_exception_types:,
|
|
75
75
|
workflow_payload_codec_thread_pool:,
|
|
76
76
|
unsafe_workflow_io_enabled:,
|
|
77
|
+
patch_activation_callback:,
|
|
77
78
|
debug_mode:,
|
|
78
79
|
assert_valid_local_activity:, on_eviction: nil
|
|
79
80
|
)
|
|
@@ -118,6 +119,7 @@ module Temporalio
|
|
|
118
119
|
t
|
|
119
120
|
end.freeze,
|
|
120
121
|
unsafe_workflow_io_enabled:,
|
|
122
|
+
patch_activation_callback:,
|
|
121
123
|
assert_valid_local_activity:
|
|
122
124
|
)
|
|
123
125
|
@state.on_eviction = on_eviction if on_eviction
|
|
@@ -145,6 +147,8 @@ module Temporalio
|
|
|
145
147
|
@state.logger.error(e)
|
|
146
148
|
end
|
|
147
149
|
|
|
150
|
+
# Returns whether completion was submitted to the bridge
|
|
151
|
+
# rubocop:disable Naming/PredicateMethod
|
|
148
152
|
def handle_activation_complete(runner:, activation_completion:, encoded:, completion_complete_queue:)
|
|
149
153
|
if @payload_encoding_visitor && !encoded
|
|
150
154
|
if Fiber.current_scheduler
|
|
@@ -154,12 +158,15 @@ module Temporalio
|
|
|
154
158
|
encode_activation_completion(runner, activation_completion)
|
|
155
159
|
end
|
|
156
160
|
end
|
|
161
|
+
false
|
|
157
162
|
else
|
|
158
163
|
@state.bridge_worker.async_complete_workflow_activation(
|
|
159
164
|
activation_completion.run_id, activation_completion.to_proto, completion_complete_queue
|
|
160
165
|
)
|
|
166
|
+
true
|
|
161
167
|
end
|
|
162
168
|
end
|
|
169
|
+
# rubocop:enable Naming/PredicateMethod
|
|
163
170
|
|
|
164
171
|
def on_shutdown_complete
|
|
165
172
|
@state.evict_all
|
|
@@ -194,7 +201,7 @@ module Temporalio
|
|
|
194
201
|
attr_reader :workflow_definitions, :bridge_worker, :logger, :metric_meter, :data_converter, :deadlock_timeout,
|
|
195
202
|
:illegal_calls, :namespace, :task_queue, :disable_eager_activity_execution,
|
|
196
203
|
:workflow_interceptors, :workflow_failure_exception_types, :unsafe_workflow_io_enabled,
|
|
197
|
-
:assert_valid_local_activity
|
|
204
|
+
:patch_activation_callback, :assert_valid_local_activity
|
|
198
205
|
|
|
199
206
|
attr_writer :on_eviction
|
|
200
207
|
|
|
@@ -202,7 +209,7 @@ module Temporalio
|
|
|
202
209
|
workflow_definitions:, bridge_worker:, logger:, metric_meter:, data_converter:, deadlock_timeout:,
|
|
203
210
|
illegal_calls:, namespace:, task_queue:, disable_eager_activity_execution:,
|
|
204
211
|
workflow_interceptors:, workflow_failure_exception_types:, unsafe_workflow_io_enabled:,
|
|
205
|
-
assert_valid_local_activity:
|
|
212
|
+
patch_activation_callback:, assert_valid_local_activity:
|
|
206
213
|
)
|
|
207
214
|
@workflow_definitions = workflow_definitions
|
|
208
215
|
@bridge_worker = bridge_worker
|
|
@@ -217,6 +224,7 @@ module Temporalio
|
|
|
217
224
|
@workflow_interceptors = workflow_interceptors
|
|
218
225
|
@workflow_failure_exception_types = workflow_failure_exception_types
|
|
219
226
|
@unsafe_workflow_io_enabled = unsafe_workflow_io_enabled
|
|
227
|
+
@patch_activation_callback = patch_activation_callback
|
|
220
228
|
@assert_valid_local_activity = assert_valid_local_activity
|
|
221
229
|
|
|
222
230
|
@running_workflows = {}
|
data/lib/temporalio/runtime.rb
CHANGED
|
@@ -46,20 +46,32 @@ module Temporalio
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
LoggingOptions = Data.define(
|
|
49
|
-
:log_filter
|
|
49
|
+
:log_filter,
|
|
50
|
+
:log_format
|
|
50
51
|
# TODO(cretz): forward_to
|
|
51
52
|
)
|
|
52
53
|
|
|
54
|
+
# Formats for Core logs written to the console.
|
|
55
|
+
module ConsoleLogFormat
|
|
56
|
+
COMPACT = :compact
|
|
57
|
+
PRETTY = :pretty
|
|
58
|
+
JSON = :json
|
|
59
|
+
end
|
|
60
|
+
|
|
53
61
|
# Logging options for runtime telemetry.
|
|
54
62
|
#
|
|
55
63
|
# @!attribute log_filter
|
|
56
64
|
# @return [LoggingFilterOptions, String] Logging filter for Core, default is new {LoggingFilterOptions} with no
|
|
57
65
|
# parameters.
|
|
66
|
+
# @!attribute log_format
|
|
67
|
+
# @return [ConsoleLogFormat, nil] Format for Core logs written to the console. If unset, this defaults to compact
|
|
68
|
+
# output.
|
|
58
69
|
class LoggingOptions
|
|
59
70
|
# Create logging options
|
|
60
71
|
#
|
|
61
72
|
# @param log_filter [LoggingFilterOptions, String] Logging filter for Core.
|
|
62
|
-
|
|
73
|
+
# @param log_format [ConsoleLogFormat, nil] Format for Core logs written to the console.
|
|
74
|
+
def initialize(log_filter: LoggingFilterOptions.new, log_format: nil)
|
|
63
75
|
super
|
|
64
76
|
end
|
|
65
77
|
|
|
@@ -73,7 +85,8 @@ module Temporalio
|
|
|
73
85
|
log_filter._to_bridge
|
|
74
86
|
else
|
|
75
87
|
raise 'Log filter must be string or LoggingFilterOptions'
|
|
76
|
-
end
|
|
88
|
+
end,
|
|
89
|
+
log_format: log_format&.to_s
|
|
77
90
|
)
|
|
78
91
|
end
|
|
79
92
|
end
|
|
@@ -101,8 +114,8 @@ module Temporalio
|
|
|
101
114
|
# @!visibility private
|
|
102
115
|
def _to_bridge
|
|
103
116
|
# @type self: LoggingFilterOptions
|
|
104
|
-
"#{other_level},
|
|
105
|
-
"temporalio_sdk=#{core_level},temporalio_bridge=#{core_level}"
|
|
117
|
+
"#{other_level},temporalio_common=#{core_level},temporalio_sdk_core=#{core_level}," \
|
|
118
|
+
"temporalio_client=#{core_level},temporalio_sdk=#{core_level},temporalio_bridge=#{core_level}"
|
|
106
119
|
end
|
|
107
120
|
end
|
|
108
121
|
|
|
@@ -332,9 +345,12 @@ module Temporalio
|
|
|
332
345
|
# @param telemetry [TelemetryOptions] Telemetry options to set.
|
|
333
346
|
# @param worker_heartbeat_interval [Float, nil] Interval for worker heartbeats in seconds. Can be nil to disable
|
|
334
347
|
# heartbeating. Interval must be between 1s and 60s.
|
|
348
|
+
# @param disable_environment_info [Boolean] When true, worker heartbeats omit runtime, hosting, and platform
|
|
349
|
+
# information. Defaults to false, which advertises this process as CRuby with `RUBY_VERSION`.
|
|
335
350
|
def initialize(
|
|
336
351
|
telemetry: TelemetryOptions.new,
|
|
337
|
-
worker_heartbeat_interval: 60
|
|
352
|
+
worker_heartbeat_interval: 60,
|
|
353
|
+
disable_environment_info: false
|
|
338
354
|
)
|
|
339
355
|
if !worker_heartbeat_interval.nil? && !worker_heartbeat_interval.positive?
|
|
340
356
|
raise 'Worker heartbeat interval must be positive'
|
|
@@ -346,7 +362,9 @@ module Temporalio
|
|
|
346
362
|
@core_runtime = Internal::Bridge::Runtime.new(
|
|
347
363
|
Internal::Bridge::Runtime::Options.new(
|
|
348
364
|
telemetry: telemetry._to_bridge,
|
|
349
|
-
worker_heartbeat_interval
|
|
365
|
+
worker_heartbeat_interval:,
|
|
366
|
+
disable_environment_info:,
|
|
367
|
+
runtime_version: RUBY_VERSION
|
|
350
368
|
)
|
|
351
369
|
)
|
|
352
370
|
@metric_meter = Internal::Metric::Meter.create_from_runtime(self) || Metric::Meter.null
|
|
@@ -42,6 +42,21 @@ module Temporalio
|
|
|
42
42
|
end
|
|
43
43
|
alias log add
|
|
44
44
|
|
|
45
|
+
# returns the logger log level as an integer.
|
|
46
|
+
def level
|
|
47
|
+
lvl = super
|
|
48
|
+
|
|
49
|
+
return lvl if lvl.is_a?(Integer)
|
|
50
|
+
|
|
51
|
+
return Logger::UNKNOWN unless lvl.respond_to?(:upcase)
|
|
52
|
+
|
|
53
|
+
if Logger::Severity.const_defined?(lvl.upcase, false)
|
|
54
|
+
Logger::Severity.const_get(lvl.upcase, false)
|
|
55
|
+
else
|
|
56
|
+
Logger::UNKNOWN
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
45
60
|
# @see Logger.debug
|
|
46
61
|
def debug(progname = nil, &)
|
|
47
62
|
add(Logger::DEBUG, nil, progname, &)
|
data/lib/temporalio/version.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'temporalio/internal/google_protobuf'
|
|
4
|
+
|
|
3
5
|
module Temporalio
|
|
4
6
|
class Worker
|
|
5
7
|
# Custom validator for validating illegal workflow calls.
|
|
@@ -44,7 +46,7 @@ module Temporalio
|
|
|
44
46
|
def self.known_safe_mutex_validator
|
|
45
47
|
@known_safe_mutex_validator ||= IllegalWorkflowCallValidator.new do
|
|
46
48
|
# Only Google Protobuf use of Mutex is known to be safe, fail unless any caller location path has protobuf
|
|
47
|
-
raise 'disallowed' unless
|
|
49
|
+
raise 'disallowed' unless ::Temporalio::Internal::GoogleProtobuf.in_call_stack?(caller_locations)
|
|
48
50
|
end
|
|
49
51
|
end
|
|
50
52
|
|
|
@@ -4,6 +4,7 @@ require 'etc'
|
|
|
4
4
|
require 'temporalio/internal/bridge/api'
|
|
5
5
|
require 'temporalio/internal/proto_utils'
|
|
6
6
|
require 'temporalio/internal/worker/workflow_instance'
|
|
7
|
+
require 'temporalio/internal/workflow_task_failure_error'
|
|
7
8
|
require 'temporalio/scoped_logger'
|
|
8
9
|
require 'temporalio/worker/thread_pool'
|
|
9
10
|
require 'temporalio/worker/workflow_executor'
|
|
@@ -215,6 +216,7 @@ module Temporalio
|
|
|
215
216
|
illegal_calls: worker_state.illegal_calls,
|
|
216
217
|
workflow_failure_exception_types: worker_state.workflow_failure_exception_types,
|
|
217
218
|
unsafe_workflow_io_enabled: worker_state.unsafe_workflow_io_enabled,
|
|
219
|
+
patch_activation_callback: worker_state.patch_activation_callback,
|
|
218
220
|
assert_valid_local_activity: worker_state.assert_valid_local_activity
|
|
219
221
|
)
|
|
220
222
|
)
|
|
@@ -229,7 +231,9 @@ module Temporalio
|
|
|
229
231
|
private_constant :Worker
|
|
230
232
|
|
|
231
233
|
# Error raised when a processing a workflow task takes more than the expected amount of time.
|
|
232
|
-
class DeadlockError < Exception
|
|
234
|
+
class DeadlockError < Exception # rubocop:disable Lint/InheritException
|
|
235
|
+
include Internal::WorkflowTaskFailureError
|
|
236
|
+
end
|
|
233
237
|
end
|
|
234
238
|
end
|
|
235
239
|
end
|
|
@@ -240,10 +240,12 @@ module Temporalio
|
|
|
240
240
|
default_heartbeat_throttle_interval: 1.0,
|
|
241
241
|
max_worker_activities_per_second: nil,
|
|
242
242
|
max_task_queue_activities_per_second: nil,
|
|
243
|
+
max_eager_activity_reservations_per_workflow_task: 3,
|
|
243
244
|
graceful_shutdown_period: 0.0,
|
|
244
245
|
nondeterminism_as_workflow_fail:,
|
|
245
246
|
nondeterminism_as_workflow_fail_for_types:,
|
|
246
247
|
deployment_options: Worker.default_deployment_options._to_bridge_options,
|
|
248
|
+
disable_payload_error_limit: true,
|
|
247
249
|
plugins: options.plugins.map(&:name).uniq.sort
|
|
248
250
|
)
|
|
249
251
|
)
|
|
@@ -264,6 +266,7 @@ module Temporalio
|
|
|
264
266
|
workflow_failure_exception_types: options.workflow_failure_exception_types,
|
|
265
267
|
workflow_payload_codec_thread_pool: options.workflow_payload_codec_thread_pool,
|
|
266
268
|
unsafe_workflow_io_enabled: options.unsafe_workflow_io_enabled,
|
|
269
|
+
patch_activation_callback: nil,
|
|
267
270
|
debug_mode: options.debug_mode,
|
|
268
271
|
on_eviction: proc { |_, remove_job| @last_workflow_remove_job = remove_job }, # steep:ignore
|
|
269
272
|
assert_valid_local_activity: ->(_) {}
|
|
@@ -271,6 +274,8 @@ module Temporalio
|
|
|
271
274
|
|
|
272
275
|
# Create the runner
|
|
273
276
|
@runner = Internal::Worker::MultiRunner.new(workers: [self], shutdown_signals: [])
|
|
277
|
+
@pending_workflow_activations = 0
|
|
278
|
+
@pending_workflow_activation_completions = 0
|
|
274
279
|
end
|
|
275
280
|
|
|
276
281
|
# Replay a workflow history.
|
|
@@ -295,11 +300,12 @@ module Temporalio
|
|
|
295
300
|
history.workflow_id, Api::History::V1::History.new(events: history.events).to_proto
|
|
296
301
|
)
|
|
297
302
|
|
|
298
|
-
# Process events until workflow complete
|
|
299
|
-
until @last_workflow_remove_job
|
|
303
|
+
# Process events until workflow complete and all completions submitted to core have finished.
|
|
304
|
+
until @last_workflow_remove_job && workflow_activation_work_drained?
|
|
300
305
|
event = @runner.next_event
|
|
301
306
|
case event
|
|
302
307
|
when Internal::Worker::MultiRunner::Event::PollSuccess
|
|
308
|
+
@pending_workflow_activations += 1
|
|
303
309
|
@workflow_worker.handle_activation(
|
|
304
310
|
runner: @runner,
|
|
305
311
|
activation: Internal::Bridge::Api::WorkflowActivation::WorkflowActivation.decode(event.bytes),
|
|
@@ -308,14 +314,17 @@ module Temporalio
|
|
|
308
314
|
when Internal::Worker::MultiRunner::Event::WorkflowActivationDecoded
|
|
309
315
|
@workflow_worker.handle_activation(runner: @runner, activation: event.activation, decoded: true)
|
|
310
316
|
when Internal::Worker::MultiRunner::Event::WorkflowActivationComplete
|
|
311
|
-
@workflow_worker.handle_activation_complete(
|
|
317
|
+
if @workflow_worker.handle_activation_complete(
|
|
312
318
|
runner: @runner,
|
|
313
319
|
activation_completion: event.activation_completion,
|
|
314
320
|
encoded: event.encoded,
|
|
315
321
|
completion_complete_queue: event.completion_complete_queue
|
|
316
322
|
)
|
|
323
|
+
@pending_workflow_activations -= 1
|
|
324
|
+
@pending_workflow_activation_completions += 1
|
|
325
|
+
end
|
|
317
326
|
when Internal::Worker::MultiRunner::Event::WorkflowActivationCompletionComplete
|
|
318
|
-
|
|
327
|
+
@pending_workflow_activation_completions -= 1
|
|
319
328
|
else
|
|
320
329
|
raise "Unexpected event: #{event}"
|
|
321
330
|
end
|
|
@@ -365,6 +374,12 @@ module Temporalio
|
|
|
365
374
|
def _wait_all_complete
|
|
366
375
|
# Do nothing
|
|
367
376
|
end
|
|
377
|
+
|
|
378
|
+
private
|
|
379
|
+
|
|
380
|
+
def workflow_activation_work_drained?
|
|
381
|
+
@pending_workflow_activations.zero? && @pending_workflow_activation_completions.zero?
|
|
382
|
+
end
|
|
368
383
|
end
|
|
369
384
|
end
|
|
370
385
|
end
|
data/lib/temporalio/worker.rb
CHANGED
|
@@ -28,6 +28,17 @@ module Temporalio
|
|
|
28
28
|
# {run_all} is used for a collection of workers. These can wait until a block is complete or a {Cancellation} is
|
|
29
29
|
# canceled.
|
|
30
30
|
class Worker
|
|
31
|
+
# Input for the experimental `patch_activation_callback:` worker option.
|
|
32
|
+
#
|
|
33
|
+
# @!attribute [r] workflow_info
|
|
34
|
+
# @return [Workflow::Info] Information about the workflow execution calling {Workflow.patched}.
|
|
35
|
+
# @!attribute [r] patch_id
|
|
36
|
+
# @return [String] Patch ID passed to {Workflow.patched}.
|
|
37
|
+
PatchActivationInput = Data.define(
|
|
38
|
+
:workflow_info,
|
|
39
|
+
:patch_id
|
|
40
|
+
)
|
|
41
|
+
|
|
31
42
|
Options = Data.define(
|
|
32
43
|
:client,
|
|
33
44
|
:task_queue,
|
|
@@ -50,6 +61,7 @@ module Temporalio
|
|
|
50
61
|
:default_heartbeat_throttle_interval,
|
|
51
62
|
:max_activities_per_second,
|
|
52
63
|
:max_task_queue_activities_per_second,
|
|
64
|
+
:max_eager_activity_reservations_per_workflow_task,
|
|
53
65
|
:graceful_shutdown_period,
|
|
54
66
|
:disable_eager_activity_execution,
|
|
55
67
|
:illegal_workflow_calls,
|
|
@@ -57,9 +69,11 @@ module Temporalio
|
|
|
57
69
|
:workflow_payload_codec_thread_pool,
|
|
58
70
|
:unsafe_workflow_io_enabled,
|
|
59
71
|
:deployment_options,
|
|
72
|
+
:patch_activation_callback,
|
|
60
73
|
:workflow_task_poller_behavior,
|
|
61
74
|
:activity_task_poller_behavior,
|
|
62
|
-
:debug_mode
|
|
75
|
+
:debug_mode,
|
|
76
|
+
:disable_payload_error_limit
|
|
63
77
|
)
|
|
64
78
|
|
|
65
79
|
# Options as returned from {options} for `**to_h` splat use in {initialize}. See {initialize} for details.
|
|
@@ -81,12 +95,16 @@ module Temporalio
|
|
|
81
95
|
# hashing all bytecode of required files. This means later/dynamic require
|
|
82
96
|
# won't be accounted for because this is memoized. It also means the
|
|
83
97
|
# tiniest code change will affect this, which is what we want since this
|
|
84
|
-
# is meant to be a "binary checksum". We
|
|
85
|
-
# similarity with other SDKs, and because security is not a factor.
|
|
98
|
+
# is meant to be a "binary checksum". We default to MD5 for speed,
|
|
99
|
+
# similarity with other SDKs, and because security is not a factor. On
|
|
100
|
+
# FIPS builds we use SHA-256 instead, since MD5 is rejected by FIPS-mode
|
|
101
|
+
# OpenSSL. This is opt-in (tied to the FIPS build) so existing,
|
|
102
|
+
# non-FIPS users keep their stable MD5-based build IDs.
|
|
86
103
|
require 'digest'
|
|
87
104
|
|
|
105
|
+
initial_digest = Internal::Bridge::FIPS ? Digest::SHA256.new : Digest::MD5.new
|
|
88
106
|
saw_bridge = false
|
|
89
|
-
build_id = $LOADED_FEATURES.each_with_object(
|
|
107
|
+
build_id = $LOADED_FEATURES.each_with_object(initial_digest) do |file, digest|
|
|
90
108
|
saw_bridge = true if file.include?('temporalio_bridge.')
|
|
91
109
|
digest.update(File.read(file)) if File.file?(file)
|
|
92
110
|
end.hexdigest
|
|
@@ -166,6 +184,7 @@ module Temporalio
|
|
|
166
184
|
raise ArgumentError, 'Not all parameters are workers' unless workers.all?(Worker)
|
|
167
185
|
|
|
168
186
|
Internal::Bridge.assert_fiber_compatibility!
|
|
187
|
+
Internal::Bridge.assert_fips_compatibility!
|
|
169
188
|
|
|
170
189
|
# Start the multi runner
|
|
171
190
|
runner = Internal::Worker::MultiRunner.new(workers:, shutdown_signals:)
|
|
@@ -398,6 +417,9 @@ module Temporalio
|
|
|
398
417
|
# @param max_task_queue_activities_per_second [Float, nil] Sets the maximum number of activities per second the task
|
|
399
418
|
# queue will dispatch, controlled server-side. Note that this only takes effect upon an activity poll request. If
|
|
400
419
|
# multiple workers on the same queue have different values set, they will thrash with the last poller winning.
|
|
420
|
+
# @param max_eager_activity_reservations_per_workflow_task [Integer] Maximum number of activity slots that may be
|
|
421
|
+
# reserved for eager execution when completing a workflow task. Defaults to 3 and must be positive. To disable
|
|
422
|
+
# eager activity execution, set `disable_eager_activity_execution: true`.
|
|
401
423
|
# @param graceful_shutdown_period [Float] Amount of time after shutdown is called that activities are given to
|
|
402
424
|
# complete before their tasks are canceled.
|
|
403
425
|
# @param disable_eager_activity_execution [Boolean] If true, disables eager activity execution. Eager activity
|
|
@@ -425,6 +447,9 @@ module Temporalio
|
|
|
425
447
|
# scheduler will fail. Instead of setting this to true, users are encouraged to use {Workflow::Unsafe.io_enabled}
|
|
426
448
|
# with a block for narrower enabling of IO.
|
|
427
449
|
# @param deployment_options [DeploymentOptions, nil] Deployment options for the worker.
|
|
450
|
+
# @param patch_activation_callback [Proc, nil] Experimental callback to decide whether the first non-replay call to
|
|
451
|
+
# {Workflow.patched} for a patch ID should activate that patch. The callback receives a {PatchActivationInput} and
|
|
452
|
+
# must return `true` to activate the patch or `false` to leave it inactive.
|
|
428
453
|
# @param workflow_task_poller_behavior [PollerBehavior] Specify the behavior of workflow task
|
|
429
454
|
# polling. Defaults to a 5-poller maximum.
|
|
430
455
|
# @param activity_task_poller_behavior [PollerBehavior] Specify the behavior of activity task
|
|
@@ -432,6 +457,9 @@ module Temporalio
|
|
|
432
457
|
# @param debug_mode [Boolean] If true, deadlock detection is disabled. Deadlock detection will fail workflow tasks
|
|
433
458
|
# if they block the thread for too long. This defaults to true if the `TEMPORAL_DEBUG` environment variable is
|
|
434
459
|
# `true` or `1`.
|
|
460
|
+
# @param disable_payload_error_limit [Boolean] If true, the worker will not proactively fail workflow/activity
|
|
461
|
+
# tasks whose payloads exceed the namespace error limits; oversized payloads are sent to the server, which
|
|
462
|
+
# enforces the limit. Defaults to false (the worker fails such tasks before sending).
|
|
435
463
|
def initialize(
|
|
436
464
|
client:,
|
|
437
465
|
task_queue:,
|
|
@@ -454,6 +482,7 @@ module Temporalio
|
|
|
454
482
|
default_heartbeat_throttle_interval: 30,
|
|
455
483
|
max_activities_per_second: nil,
|
|
456
484
|
max_task_queue_activities_per_second: nil,
|
|
485
|
+
max_eager_activity_reservations_per_workflow_task: 3,
|
|
457
486
|
graceful_shutdown_period: 0,
|
|
458
487
|
disable_eager_activity_execution: false,
|
|
459
488
|
illegal_workflow_calls: Worker.default_illegal_workflow_calls,
|
|
@@ -461,9 +490,11 @@ module Temporalio
|
|
|
461
490
|
workflow_payload_codec_thread_pool: nil,
|
|
462
491
|
unsafe_workflow_io_enabled: false,
|
|
463
492
|
deployment_options: Worker.default_deployment_options,
|
|
493
|
+
patch_activation_callback: nil,
|
|
464
494
|
workflow_task_poller_behavior: PollerBehavior::SimpleMaximum.new(max_concurrent_workflow_task_polls),
|
|
465
495
|
activity_task_poller_behavior: PollerBehavior::SimpleMaximum.new(max_concurrent_activity_task_polls),
|
|
466
|
-
debug_mode: %w[true 1].include?(ENV['TEMPORAL_DEBUG'].to_s.downcase)
|
|
496
|
+
debug_mode: %w[true 1].include?(ENV['TEMPORAL_DEBUG'].to_s.downcase),
|
|
497
|
+
disable_payload_error_limit: false
|
|
467
498
|
)
|
|
468
499
|
Internal::ProtoUtils.assert_non_reserved_name(task_queue)
|
|
469
500
|
|
|
@@ -489,6 +520,7 @@ module Temporalio
|
|
|
489
520
|
default_heartbeat_throttle_interval:,
|
|
490
521
|
max_activities_per_second:,
|
|
491
522
|
max_task_queue_activities_per_second:,
|
|
523
|
+
max_eager_activity_reservations_per_workflow_task:,
|
|
492
524
|
graceful_shutdown_period:,
|
|
493
525
|
disable_eager_activity_execution:,
|
|
494
526
|
illegal_workflow_calls:,
|
|
@@ -496,9 +528,11 @@ module Temporalio
|
|
|
496
528
|
workflow_payload_codec_thread_pool:,
|
|
497
529
|
unsafe_workflow_io_enabled:,
|
|
498
530
|
deployment_options:,
|
|
531
|
+
patch_activation_callback:,
|
|
499
532
|
workflow_task_poller_behavior:,
|
|
500
533
|
activity_task_poller_behavior:,
|
|
501
|
-
debug_mode
|
|
534
|
+
debug_mode:,
|
|
535
|
+
disable_payload_error_limit:
|
|
502
536
|
).freeze
|
|
503
537
|
# Collect applicable client plugins and worker plugins, then validate and apply to options
|
|
504
538
|
@plugins = client.options.plugins.grep(Plugin) + plugins
|
|
@@ -519,6 +553,11 @@ module Temporalio
|
|
|
519
553
|
raise ArgumentError,
|
|
520
554
|
'default_versioning_behavior must be UNSPECIFIED when use_worker_versioning is false'
|
|
521
555
|
end
|
|
556
|
+
unless @options.max_eager_activity_reservations_per_workflow_task.positive?
|
|
557
|
+
raise ArgumentError,
|
|
558
|
+
'max_eager_activity_reservations_per_workflow_task must be positive; ' \
|
|
559
|
+
'use disable_eager_activity_execution: true to disable eager activity execution'
|
|
560
|
+
end
|
|
522
561
|
|
|
523
562
|
should_enforce_versioning_behavior =
|
|
524
563
|
@options.deployment_options.use_worker_versioning &&
|
|
@@ -555,17 +594,22 @@ module Temporalio
|
|
|
555
594
|
default_heartbeat_throttle_interval: @options.default_heartbeat_throttle_interval,
|
|
556
595
|
max_worker_activities_per_second: @options.max_activities_per_second,
|
|
557
596
|
max_task_queue_activities_per_second: @options.max_task_queue_activities_per_second,
|
|
597
|
+
max_eager_activity_reservations_per_workflow_task:
|
|
598
|
+
@options.max_eager_activity_reservations_per_workflow_task,
|
|
558
599
|
graceful_shutdown_period: @options.graceful_shutdown_period,
|
|
559
600
|
nondeterminism_as_workflow_fail:,
|
|
560
601
|
nondeterminism_as_workflow_fail_for_types:,
|
|
561
602
|
deployment_options: @options.deployment_options._to_bridge_options,
|
|
562
|
-
plugins: (@options.client.options.plugins + @options.plugins).map(&:name).uniq.sort
|
|
603
|
+
plugins: (@options.client.options.plugins + @options.plugins).map(&:name).uniq.sort,
|
|
604
|
+
disable_payload_error_limit: @options.disable_payload_error_limit
|
|
563
605
|
)
|
|
564
606
|
)
|
|
565
607
|
|
|
566
608
|
# Collect interceptors from client and params
|
|
567
|
-
@activity_interceptors =
|
|
568
|
-
|
|
609
|
+
@activity_interceptors =
|
|
610
|
+
(@options.client.options.interceptors + @options.interceptors).grep(Interceptor::Activity)
|
|
611
|
+
@workflow_interceptors =
|
|
612
|
+
(@options.client.options.interceptors + @options.interceptors).grep(Interceptor::Workflow)
|
|
569
613
|
|
|
570
614
|
# Cancellation for the whole worker
|
|
571
615
|
@worker_shutdown_cancellation = Cancellation.new
|
|
@@ -591,6 +635,7 @@ module Temporalio
|
|
|
591
635
|
workflow_failure_exception_types: @options.workflow_failure_exception_types,
|
|
592
636
|
workflow_payload_codec_thread_pool: @options.workflow_payload_codec_thread_pool,
|
|
593
637
|
unsafe_workflow_io_enabled: @options.unsafe_workflow_io_enabled,
|
|
638
|
+
patch_activation_callback: @options.patch_activation_callback,
|
|
594
639
|
debug_mode: @options.debug_mode,
|
|
595
640
|
assert_valid_local_activity: ->(activity) { _assert_valid_local_activity(activity) }
|
|
596
641
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'temporalio/internal/workflow_task_failure_error'
|
|
3
4
|
require 'temporalio/workflow'
|
|
4
5
|
|
|
5
6
|
module Temporalio
|
|
@@ -81,6 +82,10 @@ module Temporalio
|
|
|
81
82
|
@fiber = Fiber.schedule do
|
|
82
83
|
@result = block.call # steep:ignore
|
|
83
84
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
|
85
|
+
# These errors invalidate the whole workflow task. If stored and only raised on wait, the activation may
|
|
86
|
+
# complete successfully with commands that were emitted before the error.
|
|
87
|
+
raise if e.is_a?(Internal::WorkflowTaskFailureError)
|
|
88
|
+
|
|
84
89
|
@failure = e
|
|
85
90
|
ensure
|
|
86
91
|
@done = true
|
|
@@ -9,13 +9,15 @@ module Temporalio
|
|
|
9
9
|
# WARNING: Nexus support is experimental.
|
|
10
10
|
module NexusOperationCancellationType
|
|
11
11
|
# Wait for cancellation to complete (default).
|
|
12
|
-
WAIT_CANCELLATION_COMPLETED =
|
|
12
|
+
WAIT_CANCELLATION_COMPLETED =
|
|
13
|
+
Internal::Bridge::Api::Nexus::NexusOperationCancellationType::WAIT_CANCELLATION_COMPLETED
|
|
13
14
|
# Abandon the operation without sending a cancellation request.
|
|
14
15
|
ABANDON = Internal::Bridge::Api::Nexus::NexusOperationCancellationType::ABANDON
|
|
15
16
|
# Send a cancellation request but do not wait for confirmation.
|
|
16
17
|
TRY_CANCEL = Internal::Bridge::Api::Nexus::NexusOperationCancellationType::TRY_CANCEL
|
|
17
18
|
# Wait for the server to confirm the cancellation request was delivered.
|
|
18
|
-
WAIT_CANCELLATION_REQUESTED =
|
|
19
|
+
WAIT_CANCELLATION_REQUESTED =
|
|
20
|
+
Internal::Bridge::Api::Nexus::NexusOperationCancellationType::WAIT_CANCELLATION_REQUESTED
|
|
19
21
|
end
|
|
20
22
|
end
|
|
21
23
|
end
|