@@ -30,6 +30,7 @@ class WorkflowReplayer
3030 :illegal_workflow_calls ,
3131 :workflow_failure_exception_types ,
3232 :workflow_payload_codec_thread_pool ,
33+ :unsafe_workflow_io_enabled ,
3334 :debug_mode ,
3435 :runtime
3536 )
@@ -69,6 +70,9 @@ class Options; end # rubocop:disable Lint/EmptyClass
6970 # @param workflow_payload_codec_thread_pool [ThreadPool, nil] Thread pool to run payload codec encode/decode
7071 # within. This is required if a payload codec exists and the worker is not fiber based. Codecs can potentially
7172 # block execution which is why they need to be run in the background.
73+ # @param unsafe_workflow_io_enabled [Boolean] If false, the default, workflow code that invokes io_wait on the
74+ # fiber scheduler will fail. Instead of setting this to true, users are encouraged to use
75+ # {Workflow::Unsafe.io_enabled} with a block for narrower enabling of IO.
7276 # @param debug_mode [Boolean] If true, deadlock detection is disabled. Deadlock detection will fail workflow tasks
7377 # if they block the thread for too long. This defaults to true if the `TEMPORAL_DEBUG` environment variable is
7478 # `true` or `1`.
@@ -89,6 +93,7 @@ def initialize(
8993 illegal_workflow_calls : Worker . default_illegal_workflow_calls ,
9094 workflow_failure_exception_types : [ ] ,
9195 workflow_payload_codec_thread_pool : nil ,
96+ unsafe_workflow_io_enabled : false ,
9297 debug_mode : %w[ true 1 ] . include? ( ENV [ 'TEMPORAL_DEBUG' ] . to_s . downcase ) ,
9398 runtime : Runtime . default ,
9499 &
@@ -106,6 +111,7 @@ def initialize(
106111 illegal_workflow_calls :,
107112 workflow_failure_exception_types :,
108113 workflow_payload_codec_thread_pool :,
114+ unsafe_workflow_io_enabled :,
109115 debug_mode :,
110116 runtime :
111117 ) . freeze
@@ -237,6 +243,7 @@ def initialize(
237243 illegal_workflow_calls : options . illegal_workflow_calls ,
238244 workflow_failure_exception_types : options . workflow_failure_exception_types ,
239245 workflow_payload_codec_thread_pool : options . workflow_payload_codec_thread_pool ,
246+ unsafe_workflow_io_enabled : options . unsafe_workflow_io_enabled ,
240247 debug_mode : options . debug_mode ,
241248 on_eviction : proc { |_ , remove_job | @last_workflow_remove_job = remove_job } # steep:ignore
242249 )
0 commit comments