temporalio 0.6.0-aarch64-linux-musl → 1.1.0-aarch64-linux-musl

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/lib/temporalio/activity/info.rb +5 -0
  4. data/lib/temporalio/api/cloud/account/v1/message.rb +3 -1
  5. data/lib/temporalio/api/cloud/cloudservice/v1/request_response.rb +5 -1
  6. data/lib/temporalio/api/cloud/cloudservice/v1/service.rb +1 -1
  7. data/lib/temporalio/api/cloud/sink/v1/message.rb +3 -1
  8. data/lib/temporalio/api/deployment/v1/message.rb +1 -1
  9. data/lib/temporalio/api/namespace/v1/message.rb +1 -1
  10. data/lib/temporalio/api/payload_visitor.rb +6 -0
  11. data/lib/temporalio/api/workflowservice/v1/request_response.rb +5 -1
  12. data/lib/temporalio/api/workflowservice/v1/service.rb +1 -1
  13. data/lib/temporalio/cancellation.rb +2 -2
  14. data/lib/temporalio/client/async_activity_handle.rb +1 -0
  15. data/lib/temporalio/client/connection/cloud_service.rb +30 -0
  16. data/lib/temporalio/client/connection/workflow_service.rb +30 -0
  17. data/lib/temporalio/client/connection.rb +14 -9
  18. data/lib/temporalio/client.rb +1 -1
  19. data/lib/temporalio/contrib/open_telemetry.rb +78 -25
  20. data/lib/temporalio/converters/payload_converter/composite.rb +1 -0
  21. data/lib/temporalio/converters/payload_converter/json_protobuf.rb +1 -1
  22. data/lib/temporalio/env_config.rb +343 -0
  23. data/lib/temporalio/error.rb +5 -1
  24. data/lib/temporalio/internal/bridge/3.2/temporalio_bridge.so +0 -0
  25. data/lib/temporalio/internal/bridge/3.3/temporalio_bridge.so +0 -0
  26. data/lib/temporalio/internal/bridge/3.4/temporalio_bridge.so +0 -0
  27. data/lib/temporalio/internal/bridge/api/workflow_activation/workflow_activation.rb +1 -1
  28. data/lib/temporalio/internal/bridge/runtime.rb +1 -0
  29. data/lib/temporalio/internal/bridge/worker.rb +54 -3
  30. data/lib/temporalio/internal/client/implementation.rb +7 -2
  31. data/lib/temporalio/internal/worker/activity_worker.rb +1 -0
  32. data/lib/temporalio/internal/worker/workflow_instance/context.rb +2 -0
  33. data/lib/temporalio/internal/worker/workflow_instance/illegal_call_tracer.rb +17 -10
  34. data/lib/temporalio/internal/worker/workflow_instance/outbound_implementation.rb +6 -5
  35. data/lib/temporalio/internal/worker/workflow_instance.rb +78 -80
  36. data/lib/temporalio/runtime.rb +16 -3
  37. data/lib/temporalio/testing/activity_environment.rb +1 -0
  38. data/lib/temporalio/version.rb +1 -1
  39. data/lib/temporalio/worker/interceptor.rb +1 -0
  40. data/lib/temporalio/worker/tuner.rb +183 -18
  41. data/lib/temporalio/worker/workflow_replayer.rb +4 -3
  42. data/lib/temporalio/worker.rb +4 -5
  43. data/lib/temporalio/workflow/info.rb +7 -0
  44. data/lib/temporalio/workflow.rb +6 -3
  45. metadata +3 -2
@@ -17,7 +17,7 @@ require 'temporalio/internal/bridge/api/common/common'
17
17
  require 'temporalio/internal/bridge/api/nexus/nexus'
18
18
 
19
19
 
20
- descriptor_data = "\n?temporal/sdk/core/workflow_activation/workflow_activation.proto\x12\x1b\x63oresdk.workflow_activation\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a%temporal/api/failure/v1/message.proto\x1a$temporal/api/update/v1/message.proto\x1a$temporal/api/common/v1/message.proto\x1a$temporal/api/enums/v1/workflow.proto\x1a\x37temporal/sdk/core/activity_result/activity_result.proto\x1a\x35temporal/sdk/core/child_workflow/child_workflow.proto\x1a%temporal/sdk/core/common/common.proto\x1a#temporal/sdk/core/nexus/nexus.proto\"\xfa\x02\n\x12WorkflowActivation\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cis_replaying\x18\x03 \x01(\x08\x12\x16\n\x0ehistory_length\x18\x04 \x01(\r\x12@\n\x04jobs\x18\x05 \x03(\x0b\x32\x32.coresdk.workflow_activation.WorkflowActivationJob\x12 \n\x18\x61vailable_internal_flags\x18\x06 \x03(\r\x12\x1a\n\x12history_size_bytes\x18\x07 \x01(\x04\x12!\n\x19\x63ontinue_as_new_suggested\x18\x08 \x01(\x08\x12T\n#deployment_version_for_current_task\x18\t \x01(\x0b\x32\'.coresdk.common.WorkerDeploymentVersion\"\xe0\n\n\x15WorkflowActivationJob\x12N\n\x13initialize_workflow\x18\x01 \x01(\x0b\x32/.coresdk.workflow_activation.InitializeWorkflowH\x00\x12<\n\nfire_timer\x18\x02 \x01(\x0b\x32&.coresdk.workflow_activation.FireTimerH\x00\x12K\n\x12update_random_seed\x18\x04 \x01(\x0b\x32-.coresdk.workflow_activation.UpdateRandomSeedH\x00\x12\x44\n\x0equery_workflow\x18\x05 \x01(\x0b\x32*.coresdk.workflow_activation.QueryWorkflowH\x00\x12\x46\n\x0f\x63\x61ncel_workflow\x18\x06 \x01(\x0b\x32+.coresdk.workflow_activation.CancelWorkflowH\x00\x12\x46\n\x0fsignal_workflow\x18\x07 \x01(\x0b\x32+.coresdk.workflow_activation.SignalWorkflowH\x00\x12H\n\x10resolve_activity\x18\x08 \x01(\x0b\x32,.coresdk.workflow_activation.ResolveActivityH\x00\x12G\n\x10notify_has_patch\x18\t \x01(\x0b\x32+.coresdk.workflow_activation.NotifyHasPatchH\x00\x12q\n&resolve_child_workflow_execution_start\x18\n \x01(\x0b\x32?.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartH\x00\x12\x66\n resolve_child_workflow_execution\x18\x0b \x01(\x0b\x32:.coresdk.workflow_activation.ResolveChildWorkflowExecutionH\x00\x12\x66\n resolve_signal_external_workflow\x18\x0c \x01(\x0b\x32:.coresdk.workflow_activation.ResolveSignalExternalWorkflowH\x00\x12u\n(resolve_request_cancel_external_workflow\x18\r \x01(\x0b\x32\x41.coresdk.workflow_activation.ResolveRequestCancelExternalWorkflowH\x00\x12:\n\tdo_update\x18\x0e \x01(\x0b\x32%.coresdk.workflow_activation.DoUpdateH\x00\x12`\n\x1dresolve_nexus_operation_start\x18\x0f \x01(\x0b\x32\x37.coresdk.workflow_activation.ResolveNexusOperationStartH\x00\x12U\n\x17resolve_nexus_operation\x18\x10 \x01(\x0b\x32\x32.coresdk.workflow_activation.ResolveNexusOperationH\x00\x12I\n\x11remove_from_cache\x18\x32 \x01(\x0b\x32,.coresdk.workflow_activation.RemoveFromCacheH\x00\x42\t\n\x07variant\"\xd9\n\n\x12InitializeWorkflow\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x17\n\x0frandomness_seed\x18\x04 \x01(\x04\x12M\n\x07headers\x18\x05 \x03(\x0b\x32<.coresdk.workflow_activation.InitializeWorkflow.HeadersEntry\x12\x10\n\x08identity\x18\x06 \x01(\t\x12I\n\x14parent_workflow_info\x18\x07 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecution\x12=\n\x1aworkflow_execution_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14workflow_run_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1f\x63ontinued_from_execution_run_id\x18\x0b \x01(\t\x12J\n\x13\x63ontinued_initiator\x18\x0c \x01(\x0e\x32-.temporal.api.enums.v1.ContinueAsNewInitiator\x12;\n\x11\x63ontinued_failure\x18\r \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\x0e \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x1e\n\x16\x66irst_execution_run_id\x18\x0f \x01(\t\x12\x39\n\x0cretry_policy\x18\x10 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x0f\n\x07\x61ttempt\x18\x11 \x01(\x05\x12\x15\n\rcron_schedule\x18\x12 \x01(\t\x12\x46\n\"workflow_execution_expiration_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x45\n\"cron_schedule_to_schedule_interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.Duration\x12*\n\x04memo\x18\x15 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x16 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12.\n\nstart_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12@\n\rroot_workflow\x18\x18 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x32\n\x08priority\x18\x19 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x18\n\tFireTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\"m\n\x0fResolveActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12;\n\x06result\x18\x02 \x01(\x0b\x32+.coresdk.activity_result.ActivityResolution\x12\x10\n\x08is_local\x18\x03 \x01(\x08\"\xd1\x02\n\"ResolveChildWorkflowExecutionStart\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12[\n\tsucceeded\x18\x02 \x01(\x0b\x32\x46.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartSuccessH\x00\x12X\n\x06\x66\x61iled\x18\x03 \x01(\x0b\x32\x46.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartFailureH\x00\x12]\n\tcancelled\x18\x04 \x01(\x0b\x32H.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartCancelledH\x00\x42\x08\n\x06status\";\n)ResolveChildWorkflowExecutionStartSuccess\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\xa6\x01\n)ResolveChildWorkflowExecutionStartFailure\x12\x13\n\x0bworkflow_id\x18\x01 \x01(\t\x12\x15\n\rworkflow_type\x18\x02 \x01(\t\x12M\n\x05\x63\x61use\x18\x03 \x01(\x0e\x32>.coresdk.child_workflow.StartChildWorkflowExecutionFailedCause\"`\n+ResolveChildWorkflowExecutionStartCancelled\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"i\n\x1dResolveChildWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12;\n\x06result\x18\x02 \x01(\x0b\x32+.coresdk.child_workflow.ChildWorkflowResult\"+\n\x10UpdateRandomSeed\x12\x17\n\x0frandomness_seed\x18\x01 \x01(\x04\"\x84\x02\n\rQueryWorkflow\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12\x12\n\nquery_type\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12H\n\x07headers\x18\x05 \x03(\x0b\x32\x37.coresdk.workflow_activation.QueryWorkflow.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\" \n\x0e\x43\x61ncelWorkflow\x12\x0e\n\x06reason\x18\x01 \x01(\t\"\x83\x02\n\x0eSignalWorkflow\x12\x13\n\x0bsignal_name\x18\x01 \x01(\t\x12.\n\x05input\x18\x02 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x10\n\x08identity\x18\x03 \x01(\t\x12I\n\x07headers\x18\x05 \x03(\x0b\x32\x38.coresdk.workflow_activation.SignalWorkflow.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\"\n\x0eNotifyHasPatch\x12\x10\n\x08patch_id\x18\x01 \x01(\t\"_\n\x1dResolveSignalExternalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x31\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"f\n$ResolveRequestCancelExternalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x31\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xcb\x02\n\x08\x44oUpdate\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\x14protocol_instance_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12.\n\x05input\x18\x04 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x43\n\x07headers\x18\x05 \x03(\x0b\x32\x32.coresdk.workflow_activation.DoUpdate.HeadersEntry\x12*\n\x04meta\x18\x06 \x01(\x0b\x32\x1c.temporal.api.update.v1.Meta\x12\x15\n\rrun_validator\x18\x07 \x01(\x08\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x9a\x01\n\x1aResolveNexusOperationStart\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x19\n\x0foperation_token\x18\x02 \x01(\tH\x00\x12\x16\n\x0cstarted_sync\x18\x03 \x01(\x08H\x00\x12\x32\n\x06\x66\x61iled\x18\x04 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\x08\n\x06status\"Y\n\x15ResolveNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x33\n\x06result\x18\x02 \x01(\x0b\x32#.coresdk.nexus.NexusOperationResult\"\xe0\x02\n\x0fRemoveFromCache\x12\x0f\n\x07message\x18\x01 \x01(\t\x12K\n\x06reason\x18\x02 \x01(\x0e\x32;.coresdk.workflow_activation.RemoveFromCache.EvictionReason\"\xee\x01\n\x0e\x45victionReason\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0e\n\nCACHE_FULL\x10\x01\x12\x0e\n\nCACHE_MISS\x10\x02\x12\x12\n\x0eNONDETERMINISM\x10\x03\x12\r\n\tLANG_FAIL\x10\x04\x12\x12\n\x0eLANG_REQUESTED\x10\x05\x12\x12\n\x0eTASK_NOT_FOUND\x10\x06\x12\x15\n\x11UNHANDLED_COMMAND\x10\x07\x12\t\n\x05\x46\x41TAL\x10\x08\x12\x1f\n\x1bPAGINATION_OR_HISTORY_FETCH\x10\t\x12\x1d\n\x19WORKFLOW_EXECUTION_ENDING\x10\nB8\xea\x02\x35Temporalio::Internal::Bridge::Api::WorkflowActivationb\x06proto3"
20
+ descriptor_data = "\n?temporal/sdk/core/workflow_activation/workflow_activation.proto\x12\x1b\x63oresdk.workflow_activation\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a%temporal/api/failure/v1/message.proto\x1a$temporal/api/update/v1/message.proto\x1a$temporal/api/common/v1/message.proto\x1a$temporal/api/enums/v1/workflow.proto\x1a\x37temporal/sdk/core/activity_result/activity_result.proto\x1a\x35temporal/sdk/core/child_workflow/child_workflow.proto\x1a%temporal/sdk/core/common/common.proto\x1a#temporal/sdk/core/nexus/nexus.proto\"\x94\x03\n\x12WorkflowActivation\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12-\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cis_replaying\x18\x03 \x01(\x08\x12\x16\n\x0ehistory_length\x18\x04 \x01(\r\x12@\n\x04jobs\x18\x05 \x03(\x0b\x32\x32.coresdk.workflow_activation.WorkflowActivationJob\x12 \n\x18\x61vailable_internal_flags\x18\x06 \x03(\r\x12\x1a\n\x12history_size_bytes\x18\x07 \x01(\x04\x12!\n\x19\x63ontinue_as_new_suggested\x18\x08 \x01(\x08\x12T\n#deployment_version_for_current_task\x18\t \x01(\x0b\x32\'.coresdk.common.WorkerDeploymentVersion\x12\x18\n\x10last_sdk_version\x18\n \x01(\t\"\xe0\n\n\x15WorkflowActivationJob\x12N\n\x13initialize_workflow\x18\x01 \x01(\x0b\x32/.coresdk.workflow_activation.InitializeWorkflowH\x00\x12<\n\nfire_timer\x18\x02 \x01(\x0b\x32&.coresdk.workflow_activation.FireTimerH\x00\x12K\n\x12update_random_seed\x18\x04 \x01(\x0b\x32-.coresdk.workflow_activation.UpdateRandomSeedH\x00\x12\x44\n\x0equery_workflow\x18\x05 \x01(\x0b\x32*.coresdk.workflow_activation.QueryWorkflowH\x00\x12\x46\n\x0f\x63\x61ncel_workflow\x18\x06 \x01(\x0b\x32+.coresdk.workflow_activation.CancelWorkflowH\x00\x12\x46\n\x0fsignal_workflow\x18\x07 \x01(\x0b\x32+.coresdk.workflow_activation.SignalWorkflowH\x00\x12H\n\x10resolve_activity\x18\x08 \x01(\x0b\x32,.coresdk.workflow_activation.ResolveActivityH\x00\x12G\n\x10notify_has_patch\x18\t \x01(\x0b\x32+.coresdk.workflow_activation.NotifyHasPatchH\x00\x12q\n&resolve_child_workflow_execution_start\x18\n \x01(\x0b\x32?.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartH\x00\x12\x66\n resolve_child_workflow_execution\x18\x0b \x01(\x0b\x32:.coresdk.workflow_activation.ResolveChildWorkflowExecutionH\x00\x12\x66\n resolve_signal_external_workflow\x18\x0c \x01(\x0b\x32:.coresdk.workflow_activation.ResolveSignalExternalWorkflowH\x00\x12u\n(resolve_request_cancel_external_workflow\x18\r \x01(\x0b\x32\x41.coresdk.workflow_activation.ResolveRequestCancelExternalWorkflowH\x00\x12:\n\tdo_update\x18\x0e \x01(\x0b\x32%.coresdk.workflow_activation.DoUpdateH\x00\x12`\n\x1dresolve_nexus_operation_start\x18\x0f \x01(\x0b\x32\x37.coresdk.workflow_activation.ResolveNexusOperationStartH\x00\x12U\n\x17resolve_nexus_operation\x18\x10 \x01(\x0b\x32\x32.coresdk.workflow_activation.ResolveNexusOperationH\x00\x12I\n\x11remove_from_cache\x18\x32 \x01(\x0b\x32,.coresdk.workflow_activation.RemoveFromCacheH\x00\x42\t\n\x07variant\"\xd9\n\n\x12InitializeWorkflow\x12\x15\n\rworkflow_type\x18\x01 \x01(\t\x12\x13\n\x0bworkflow_id\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x17\n\x0frandomness_seed\x18\x04 \x01(\x04\x12M\n\x07headers\x18\x05 \x03(\x0b\x32<.coresdk.workflow_activation.InitializeWorkflow.HeadersEntry\x12\x10\n\x08identity\x18\x06 \x01(\t\x12I\n\x14parent_workflow_info\x18\x07 \x01(\x0b\x32+.coresdk.common.NamespacedWorkflowExecution\x12=\n\x1aworkflow_execution_timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14workflow_run_timeout\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x38\n\x15workflow_task_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1f\x63ontinued_from_execution_run_id\x18\x0b \x01(\t\x12J\n\x13\x63ontinued_initiator\x18\x0c \x01(\x0e\x32-.temporal.api.enums.v1.ContinueAsNewInitiator\x12;\n\x11\x63ontinued_failure\x18\r \x01(\x0b\x32 .temporal.api.failure.v1.Failure\x12@\n\x16last_completion_result\x18\x0e \x01(\x0b\x32 .temporal.api.common.v1.Payloads\x12\x1e\n\x16\x66irst_execution_run_id\x18\x0f \x01(\t\x12\x39\n\x0cretry_policy\x18\x10 \x01(\x0b\x32#.temporal.api.common.v1.RetryPolicy\x12\x0f\n\x07\x61ttempt\x18\x11 \x01(\x05\x12\x15\n\rcron_schedule\x18\x12 \x01(\t\x12\x46\n\"workflow_execution_expiration_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x45\n\"cron_schedule_to_schedule_interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.Duration\x12*\n\x04memo\x18\x15 \x01(\x0b\x32\x1c.temporal.api.common.v1.Memo\x12\x43\n\x11search_attributes\x18\x16 \x01(\x0b\x32(.temporal.api.common.v1.SearchAttributes\x12.\n\nstart_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12@\n\rroot_workflow\x18\x18 \x01(\x0b\x32).temporal.api.common.v1.WorkflowExecution\x12\x32\n\x08priority\x18\x19 \x01(\x0b\x32 .temporal.api.common.v1.Priority\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x18\n\tFireTimer\x12\x0b\n\x03seq\x18\x01 \x01(\r\"m\n\x0fResolveActivity\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12;\n\x06result\x18\x02 \x01(\x0b\x32+.coresdk.activity_result.ActivityResolution\x12\x10\n\x08is_local\x18\x03 \x01(\x08\"\xd1\x02\n\"ResolveChildWorkflowExecutionStart\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12[\n\tsucceeded\x18\x02 \x01(\x0b\x32\x46.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartSuccessH\x00\x12X\n\x06\x66\x61iled\x18\x03 \x01(\x0b\x32\x46.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartFailureH\x00\x12]\n\tcancelled\x18\x04 \x01(\x0b\x32H.coresdk.workflow_activation.ResolveChildWorkflowExecutionStartCancelledH\x00\x42\x08\n\x06status\";\n)ResolveChildWorkflowExecutionStartSuccess\x12\x0e\n\x06run_id\x18\x01 \x01(\t\"\xa6\x01\n)ResolveChildWorkflowExecutionStartFailure\x12\x13\n\x0bworkflow_id\x18\x01 \x01(\t\x12\x15\n\rworkflow_type\x18\x02 \x01(\t\x12M\n\x05\x63\x61use\x18\x03 \x01(\x0e\x32>.coresdk.child_workflow.StartChildWorkflowExecutionFailedCause\"`\n+ResolveChildWorkflowExecutionStartCancelled\x12\x31\n\x07\x66\x61ilure\x18\x01 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"i\n\x1dResolveChildWorkflowExecution\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12;\n\x06result\x18\x02 \x01(\x0b\x32+.coresdk.child_workflow.ChildWorkflowResult\"+\n\x10UpdateRandomSeed\x12\x17\n\x0frandomness_seed\x18\x01 \x01(\x04\"\x84\x02\n\rQueryWorkflow\x12\x10\n\x08query_id\x18\x01 \x01(\t\x12\x12\n\nquery_type\x18\x02 \x01(\t\x12\x32\n\targuments\x18\x03 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12H\n\x07headers\x18\x05 \x03(\x0b\x32\x37.coresdk.workflow_activation.QueryWorkflow.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\" \n\x0e\x43\x61ncelWorkflow\x12\x0e\n\x06reason\x18\x01 \x01(\t\"\x83\x02\n\x0eSignalWorkflow\x12\x13\n\x0bsignal_name\x18\x01 \x01(\t\x12.\n\x05input\x18\x02 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x10\n\x08identity\x18\x03 \x01(\t\x12I\n\x07headers\x18\x05 \x03(\x0b\x32\x38.coresdk.workflow_activation.SignalWorkflow.HeadersEntry\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\"\n\x0eNotifyHasPatch\x12\x10\n\x08patch_id\x18\x01 \x01(\t\"_\n\x1dResolveSignalExternalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x31\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"f\n$ResolveRequestCancelExternalWorkflow\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x31\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32 .temporal.api.failure.v1.Failure\"\xcb\x02\n\x08\x44oUpdate\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1c\n\x14protocol_instance_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12.\n\x05input\x18\x04 \x03(\x0b\x32\x1f.temporal.api.common.v1.Payload\x12\x43\n\x07headers\x18\x05 \x03(\x0b\x32\x32.coresdk.workflow_activation.DoUpdate.HeadersEntry\x12*\n\x04meta\x18\x06 \x01(\x0b\x32\x1c.temporal.api.update.v1.Meta\x12\x15\n\rrun_validator\x18\x07 \x01(\x08\x1aO\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.temporal.api.common.v1.Payload:\x02\x38\x01\"\x9a\x01\n\x1aResolveNexusOperationStart\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x19\n\x0foperation_token\x18\x02 \x01(\tH\x00\x12\x16\n\x0cstarted_sync\x18\x03 \x01(\x08H\x00\x12\x32\n\x06\x66\x61iled\x18\x04 \x01(\x0b\x32 .temporal.api.failure.v1.FailureH\x00\x42\x08\n\x06status\"Y\n\x15ResolveNexusOperation\x12\x0b\n\x03seq\x18\x01 \x01(\r\x12\x33\n\x06result\x18\x02 \x01(\x0b\x32#.coresdk.nexus.NexusOperationResult\"\xe0\x02\n\x0fRemoveFromCache\x12\x0f\n\x07message\x18\x01 \x01(\t\x12K\n\x06reason\x18\x02 \x01(\x0e\x32;.coresdk.workflow_activation.RemoveFromCache.EvictionReason\"\xee\x01\n\x0e\x45victionReason\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0e\n\nCACHE_FULL\x10\x01\x12\x0e\n\nCACHE_MISS\x10\x02\x12\x12\n\x0eNONDETERMINISM\x10\x03\x12\r\n\tLANG_FAIL\x10\x04\x12\x12\n\x0eLANG_REQUESTED\x10\x05\x12\x12\n\x0eTASK_NOT_FOUND\x10\x06\x12\x15\n\x11UNHANDLED_COMMAND\x10\x07\x12\t\n\x05\x46\x41TAL\x10\x08\x12\x1f\n\x1bPAGINATION_OR_HISTORY_FETCH\x10\t\x12\x1d\n\x19WORKFLOW_EXECUTION_ENDING\x10\nB8\xea\x02\x35Temporalio::Internal::Bridge::Api::WorkflowActivationb\x06proto3"
21
21
 
22
22
  pool = ::Google::Protobuf::DescriptorPool.generated_pool
23
23
  pool.add_serialized_file(descriptor_data)
@@ -6,6 +6,7 @@ module Temporalio
6
6
  class Runtime
7
7
  Options = Struct.new(
8
8
  :telemetry,
9
+ :worker_heartbeat_interval,
9
10
  keyword_init: true
10
11
  )
11
12
 
@@ -7,8 +7,6 @@ module Temporalio
7
7
  module Bridge
8
8
  class Worker
9
9
  Options = Struct.new(
10
- :activity,
11
- :workflow,
12
10
  :namespace,
13
11
  :task_queue,
14
12
  :tuner,
@@ -17,7 +15,10 @@ module Temporalio
17
15
  :workflow_task_poller_behavior,
18
16
  :nonsticky_to_sticky_poll_ratio,
19
17
  :activity_task_poller_behavior,
20
- :no_remote_activities,
18
+ :enable_workflows,
19
+ :enable_local_activities,
20
+ :enable_remote_activities,
21
+ :enable_nexus,
21
22
  :sticky_queue_schedule_to_start_timeout,
22
23
  :max_heartbeat_throttle_interval,
23
24
  :default_heartbeat_throttle_interval,
@@ -40,6 +41,7 @@ module Temporalio
40
41
  TunerSlotSupplierOptions = Struct.new(
41
42
  :fixed_size,
42
43
  :resource_based,
44
+ :custom,
43
45
  keyword_init: true
44
46
  )
45
47
 
@@ -103,6 +105,55 @@ module Temporalio
103
105
  # TODO(cretz): Log error on this somehow?
104
106
  async_complete_activity_task(proto.to_proto, queue)
105
107
  end
108
+
109
+ class CustomSlotSupplier
110
+ def initialize(slot_supplier:, thread_pool:)
111
+ @slot_supplier = slot_supplier
112
+ @thread_pool = thread_pool
113
+ end
114
+
115
+ def reserve_slot(context, cancellation, &block)
116
+ run_user_code do
117
+ @slot_supplier.reserve_slot(context, cancellation) { |v| block.call(v) }
118
+ rescue Exception => e # rubocop:disable Lint/RescueException
119
+ block.call(e)
120
+ end
121
+ end
122
+
123
+ def try_reserve_slot(context, &block)
124
+ run_user_code do
125
+ block.call(@slot_supplier.try_reserve_slot(context))
126
+ rescue Exception => e # rubocop:disable Lint/RescueException
127
+ block.call(e)
128
+ end
129
+ end
130
+
131
+ def mark_slot_used(context, &block)
132
+ run_user_code do
133
+ block.call(@slot_supplier.mark_slot_used(context))
134
+ rescue Exception => e # rubocop:disable Lint/RescueException
135
+ block.call(e)
136
+ end
137
+ end
138
+
139
+ def release_slot(context, &block)
140
+ run_user_code do
141
+ block.call(@slot_supplier.release_slot(context))
142
+ rescue Exception => e # rubocop:disable Lint/RescueException
143
+ block.call(e)
144
+ end
145
+ end
146
+
147
+ private
148
+
149
+ def run_user_code(&)
150
+ if @thread_pool
151
+ @thread_pool.execute(&)
152
+ else
153
+ yield
154
+ end
155
+ end
156
+ end
106
157
  end
107
158
  end
108
159
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'google/protobuf/well_known_types'
4
4
  require 'securerandom'
5
+ require 'temporalio/activity'
5
6
  require 'temporalio/api'
6
7
  require 'temporalio/client/activity_id_reference'
7
8
  require 'temporalio/client/async_activity_handle'
@@ -829,9 +830,13 @@ module Temporalio
829
830
  rpc_options: Implementation.with_default_rpc_options(input.rpc_options)
830
831
  )
831
832
  end
832
- raise Error::AsyncActivityCanceledError if resp.cancel_requested
833
+ return unless resp.cancel_requested || resp.activity_paused || resp.activity_reset
833
834
 
834
- nil
835
+ raise Error::AsyncActivityCanceledError, Activity::CancellationDetails.new(
836
+ cancel_requested: resp.cancel_requested,
837
+ paused: resp.activity_paused,
838
+ reset: resp.activity_reset
839
+ )
835
840
  end
836
841
 
837
842
  def complete_async_activity(input)
@@ -185,6 +185,7 @@ module Temporalio
185
185
  payloads = codec.decode(payloads) if codec
186
186
  payloads.map { |p| Temporalio::Converters::RawValue.new(p) }
187
187
  end,
188
+ retry_policy: (RetryPolicy._from_proto(start.retry_policy) if start.retry_policy),
188
189
  schedule_to_close_timeout: Internal::ProtoUtils.duration_to_seconds(start.schedule_to_close_timeout),
189
190
  scheduled_time: Internal::ProtoUtils.timestamp_to_time(start.scheduled_time) || raise, # Never nil
190
191
  start_to_close_timeout: Internal::ProtoUtils.duration_to_seconds(start.start_to_close_timeout),
@@ -130,6 +130,7 @@ module Temporalio
130
130
  def execute_local_activity(
131
131
  activity,
132
132
  *args,
133
+ summary:,
133
134
  schedule_to_close_timeout:,
134
135
  schedule_to_start_timeout:,
135
136
  start_to_close_timeout:,
@@ -157,6 +158,7 @@ module Temporalio
157
158
  Temporalio::Worker::Interceptor::Workflow::ExecuteLocalActivityInput.new(
158
159
  activity:,
159
160
  args:,
161
+ summary:,
160
162
  schedule_to_close_timeout:,
161
163
  schedule_to_start_timeout:,
162
164
  start_to_close_timeout:,
@@ -84,7 +84,7 @@ module Temporalio
84
84
  when :all
85
85
  ''
86
86
  when Temporalio::Worker::IllegalWorkflowCallValidator
87
- disable do
87
+ disable_temporarily do
88
88
  vals.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
89
89
  class_name:, method_name: tp.callee_id, trace_point: tp
90
90
  ))
@@ -98,7 +98,7 @@ module Temporalio
98
98
  when true
99
99
  ''
100
100
  when Temporalio::Worker::IllegalWorkflowCallValidator
101
- disable do
101
+ disable_temporarily do
102
102
  per_method.block.call(Temporalio::Worker::IllegalWorkflowCallValidator::CallInfo.new(
103
103
  class_name:, method_name: tp.callee_id, trace_point: tp
104
104
  ))
@@ -118,8 +118,11 @@ module Temporalio
118
118
  end
119
119
 
120
120
  def enable(&block)
121
- # We've seen leaking issues in Ruby 3.2 where the TracePoint inadvertently remains enabled even for threads
122
- # that it was not started on. So we will check the thread ourselves.
121
+ # This is not reentrant and not expected to be called as such. We've seen leaking issues in Ruby 3.2 where
122
+ # the TracePoint inadvertently remains enabled even for threads that it was not started on. So we will check
123
+ # the thread ourselves. We also use the "enabled thread" concept for disabling checks too, see
124
+ # disable_temporarily for more details.
125
+
123
126
  @enabled_thread = Thread.current
124
127
  @tracepoint.enable do
125
128
  block.call
@@ -128,13 +131,17 @@ module Temporalio
128
131
  end
129
132
  end
130
133
 
131
- def disable(&block)
134
+ def disable_temporarily(&)
135
+ # An earlier version of this used @tracepoint.disable, but in some versions of Ruby, the observed behavior
136
+ # is confusingly not reentrant or at least not predictable. Therefore, instead of calling
137
+ # @tracepoint.disable, we are just unsetting the enabled thread. This means the tracer is still running, but
138
+ # no checks are performed. This is effectively a no-op if tracing was never enabled.
139
+
132
140
  previous_thread = @enabled_thread
133
- @tracepoint.disable do
134
- block.call
135
- ensure
136
- @enabled_thread = previous_thread
137
- end
141
+ @enabled_thread = nil
142
+ yield
143
+ ensure
144
+ @enabled_thread = previous_thread
138
145
  end
139
146
  end
140
147
  end
@@ -114,14 +114,15 @@ module Temporalio
114
114
  local_retry_threshold: ProtoUtils.seconds_to_duration(input.local_retry_threshold),
115
115
  attempt: do_backoff&.attempt || 0,
116
116
  original_schedule_time: do_backoff&.original_schedule_time
117
- )
117
+ ),
118
+ user_metadata: ProtoUtils.to_user_metadata(input.summary, nil, @instance.payload_converter)
118
119
  )
119
120
  )
120
121
  seq
121
122
  end
122
123
  end
123
124
 
124
- def execute_activity_with_local_backoffs(local:, cancellation:, result_hint:, &)
125
+ def execute_activity_with_local_backoffs(local:, cancellation:, result_hint:, &block)
125
126
  # We do not even want to schedule if the cancellation is already cancelled. We choose to use canceled
126
127
  # failure instead of wrapping in activity failure which is similar to what other SDKs do, with the accepted
127
128
  # tradeoff that it makes rescue more difficult (hence the presence of Error.canceled? helper).
@@ -130,7 +131,7 @@ module Temporalio
130
131
  # This has to be done in a loop for local activity backoff
131
132
  last_local_backoff = nil
132
133
  loop do
133
- result = execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &)
134
+ result = execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &block)
134
135
  return result unless result.is_a?(Bridge::Api::ActivityResult::DoBackoff)
135
136
 
136
137
  # @type var result: untyped
@@ -142,9 +143,9 @@ module Temporalio
142
143
  end
143
144
 
144
145
  # If this doesn't raise, it returns success | DoBackoff
145
- def execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &)
146
+ def execute_activity_once(local:, cancellation:, last_local_backoff:, result_hint:, &block)
146
147
  # Add to pending activities (removed by the resolver)
147
- seq = yield last_local_backoff
148
+ seq = block.call(last_local_backoff)
148
149
  @instance.pending_activities[seq] = Fiber.current
149
150
 
150
151
  # Add cancellation hook
@@ -125,6 +125,7 @@ module Temporalio
125
125
  continued_run_id: ProtoUtils.string_or(@init_job.continued_from_execution_run_id),
126
126
  cron_schedule: ProtoUtils.string_or(@init_job.cron_schedule),
127
127
  execution_timeout: ProtoUtils.duration_to_seconds(@init_job.workflow_execution_timeout),
128
+ first_execution_run_id: @init_job.first_execution_run_id,
128
129
  headers: ProtoUtils.headers_from_proto_map(@init_job.headers, @payload_converter) || {},
129
130
  last_failure: if @init_job.continued_failure
130
131
  @failure_converter.from_failure(@init_job.continued_failure, @payload_converter)
@@ -132,6 +133,7 @@ module Temporalio
132
133
  last_result: if @init_job.last_completion_result
133
134
  @payload_converter.from_payloads(@init_job.last_completion_result).first
134
135
  end,
136
+ has_last_result?: !@init_job.last_completion_result.nil?,
135
137
  namespace: details.namespace,
136
138
  parent: if @init_job.parent_workflow_info
137
139
  Workflow::Info::ParentInfo.new(
@@ -162,86 +164,9 @@ module Temporalio
162
164
  end
163
165
 
164
166
  def activate(activation)
165
- # Run inside of scheduler
166
- run_in_scheduler { activate_internal(activation) }
167
- end
168
-
169
- def add_command(command)
170
- raise Workflow::InvalidWorkflowStateError, 'Cannot add commands in this context' if @context_frozen
171
-
172
- @commands << command
173
- end
174
-
175
- def instance
176
- @instance or raise 'Instance accessed before created'
177
- end
178
-
179
- def search_attributes
180
- # Lazy on first access
181
- @search_attributes ||= SearchAttributes._from_proto(
182
- @init_job.search_attributes, disable_mutations: true, never_nil: true
183
- ) || raise
184
- end
185
-
186
- def memo
187
- # Lazy on first access
188
- @memo ||= ExternallyImmutableHash.new(ProtoUtils.memo_from_proto(@init_job.memo, payload_converter) || {})
189
- end
190
-
191
- def now
192
- # Create each time
193
- ProtoUtils.timestamp_to_time(@now_timestamp) or raise 'Time unexpectedly not present'
194
- end
195
-
196
- def illegal_call_tracing_disabled(&)
197
- @tracer.disable(&)
198
- end
199
-
200
- def patch(patch_id:, deprecated:)
201
- # Use memoized result if present. If this is being deprecated, we can still use memoized result and skip the
202
- # command.
203
- patch_id = patch_id.to_s
204
- @patches_memoized ||= {}
205
- @patches_memoized.fetch(patch_id) do
206
- patched = !replaying || @patches_notified.include?(patch_id)
207
- @patches_memoized[patch_id] = patched
208
- if patched
209
- add_command(
210
- Bridge::Api::WorkflowCommands::WorkflowCommand.new(
211
- set_patch_marker: Bridge::Api::WorkflowCommands::SetPatchMarker.new(patch_id:, deprecated:)
212
- )
213
- )
214
- end
215
- patched
216
- end
217
- end
218
-
219
- def metric_meter
220
- @metric_meter ||= ReplaySafeMetric::Meter.new(
221
- @runtime_metric_meter.with_additional_attributes(
222
- {
223
- namespace: info.namespace,
224
- task_queue: info.task_queue,
225
- workflow_type: info.workflow_type
226
- }
227
- )
228
- )
229
- end
230
-
231
- private
232
-
233
- def run_in_scheduler(&)
167
+ # Run inside of scheduler (removed on ensure)
234
168
  Fiber.set_scheduler(@scheduler)
235
- if @tracer
236
- @tracer.enable(&)
237
- else
238
- yield
239
- end
240
- ensure
241
- Fiber.set_scheduler(nil)
242
- end
243
169
 
244
- def activate_internal(activation)
245
170
  # Reset some activation state
246
171
  @commands = []
247
172
  @current_activation_error = nil
@@ -266,8 +191,12 @@ module Temporalio
266
191
  # the first activation)
267
192
  @primary_fiber ||= schedule(top_level: true) { run_workflow }
268
193
 
269
- # Run the event loop
270
- @scheduler.run_until_all_yielded
194
+ # Run the event loop in the tracer if it exists
195
+ if @tracer
196
+ @tracer.enable { @scheduler.run_until_all_yielded }
197
+ else
198
+ @scheduler.run_until_all_yielded
199
+ end
271
200
  rescue Exception => e # rubocop:disable Lint/RescueException
272
201
  on_top_level_exception(e)
273
202
  end
@@ -306,8 +235,77 @@ module Temporalio
306
235
  ensure
307
236
  @commands = nil
308
237
  @current_activation_error = nil
238
+ Fiber.set_scheduler(nil)
239
+ end
240
+
241
+ def add_command(command)
242
+ raise Workflow::InvalidWorkflowStateError, 'Cannot add commands in this context' if @context_frozen
243
+
244
+ @commands << command
245
+ end
246
+
247
+ def instance
248
+ @instance or raise 'Instance accessed before created'
249
+ end
250
+
251
+ def search_attributes
252
+ # Lazy on first access
253
+ @search_attributes ||= SearchAttributes._from_proto(
254
+ @init_job.search_attributes, disable_mutations: true, never_nil: true
255
+ ) || raise
256
+ end
257
+
258
+ def memo
259
+ # Lazy on first access
260
+ @memo ||= ExternallyImmutableHash.new(ProtoUtils.memo_from_proto(@init_job.memo, payload_converter) || {})
261
+ end
262
+
263
+ def now
264
+ # Create each time
265
+ ProtoUtils.timestamp_to_time(@now_timestamp) or raise 'Time unexpectedly not present'
309
266
  end
310
267
 
268
+ def illegal_call_tracing_disabled(&)
269
+ if @tracer
270
+ @tracer.disable_temporarily(&)
271
+ else
272
+ yield
273
+ end
274
+ end
275
+
276
+ def patch(patch_id:, deprecated:)
277
+ # Use memoized result if present. If this is being deprecated, we can still use memoized result and skip the
278
+ # command.
279
+ patch_id = patch_id.to_s
280
+ @patches_memoized ||= {}
281
+ @patches_memoized.fetch(patch_id) do
282
+ patched = !replaying || @patches_notified.include?(patch_id)
283
+ @patches_memoized[patch_id] = patched
284
+ if patched
285
+ add_command(
286
+ Bridge::Api::WorkflowCommands::WorkflowCommand.new(
287
+ set_patch_marker: Bridge::Api::WorkflowCommands::SetPatchMarker.new(patch_id:, deprecated:)
288
+ )
289
+ )
290
+ end
291
+ patched
292
+ end
293
+ end
294
+
295
+ def metric_meter
296
+ @metric_meter ||= ReplaySafeMetric::Meter.new(
297
+ @runtime_metric_meter.with_additional_attributes(
298
+ {
299
+ namespace: info.namespace,
300
+ task_queue: info.task_queue,
301
+ workflow_type: info.workflow_type
302
+ }
303
+ )
304
+ )
305
+ end
306
+
307
+ private
308
+
311
309
  def create_instance
312
310
  # Convert workflow arguments
313
311
  @workflow_arguments = convert_args(payload_array: @init_job.arguments,
@@ -101,7 +101,8 @@ module Temporalio
101
101
  # @!visibility private
102
102
  def _to_bridge
103
103
  # @type self: LoggingFilterOptions
104
- "#{other_level},temporal_sdk_core=#{core_level},temporal_client=#{core_level},temporal_sdk=#{core_level}"
104
+ "#{other_level},temporalio_sdk_core=#{core_level},temporalio_client=#{core_level}," \
105
+ "temporalio_sdk=#{core_level},temporalio_bridge=#{core_level}"
105
106
  end
106
107
  end
107
108
 
@@ -329,12 +330,24 @@ module Temporalio
329
330
  # pool, this also consumes a Ruby thread for its lifetime.
330
331
  #
331
332
  # @param telemetry [TelemetryOptions] Telemetry options to set.
332
- def initialize(telemetry: TelemetryOptions.new)
333
+ # @param worker_heartbeat_interval [Float, nil] Interval for worker heartbeats in seconds. Can be nil to disable
334
+ # heartbeating. Interval must be between 1s and 60s.
335
+ def initialize(
336
+ telemetry: TelemetryOptions.new,
337
+ worker_heartbeat_interval: 60
338
+ )
339
+ if !worker_heartbeat_interval.nil? && !worker_heartbeat_interval.positive?
340
+ raise 'Worker heartbeat interval must be positive'
341
+ end
342
+
333
343
  # Set runtime on the buffer which will fail if the buffer is used on another runtime
334
344
  telemetry.metrics&.buffer&._set_runtime(self)
335
345
 
336
346
  @core_runtime = Internal::Bridge::Runtime.new(
337
- Internal::Bridge::Runtime::Options.new(telemetry: telemetry._to_bridge)
347
+ Internal::Bridge::Runtime::Options.new(
348
+ telemetry: telemetry._to_bridge,
349
+ worker_heartbeat_interval:
350
+ )
338
351
  )
339
352
  @metric_meter = Internal::Metric::Meter.create_from_runtime(self) || Metric::Meter.null
340
353
  # We need a thread to run the command loop
@@ -25,6 +25,7 @@ module Temporalio
25
25
  local?: false,
26
26
  priority: Temporalio::Priority.default,
27
27
  raw_heartbeat_details: [],
28
+ retry_policy: RetryPolicy.new,
28
29
  schedule_to_close_timeout: 1.0,
29
30
  scheduled_time: Time.at(0),
30
31
  start_to_close_timeout: 1.0,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Temporalio
4
- VERSION = '0.6.0'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -228,6 +228,7 @@ module Temporalio
228
228
  ExecuteLocalActivityInput = Data.define(
229
229
  :activity,
230
230
  :args,
231
+ :summary,
231
232
  :schedule_to_close_timeout,
232
233
  :schedule_to_start_timeout,
233
234
  :start_to_close_timeout,