Module: Temporalio::Workflow::Unsafe
- Defined in:
- lib/temporalio/workflow.rb
Overview
Unsafe module contains only-in-workflow methods that are considered unsafe. These should not be used unless the consequences are understood.
Class Method Summary collapse
-
.durable_scheduler_disabled ⇒ Object
Run a block of code with the durable/deterministic workflow Fiber scheduler off.
-
.illegal_call_tracing_disabled { ... } ⇒ Object
Run a block of code with illegal call tracing disabled.
-
.io_enabled ⇒ Object
Run a block of code with IO enabled.
-
.replaying? ⇒ Boolean
True if the workflow is replaying (including during queries and update validators), false otherwise.
-
.replaying_history_events? ⇒ Boolean
True if the workflow is replaying history events (excluding queries and update validators), false otherwise.
Class Method Details
.durable_scheduler_disabled ⇒ Object
Run a block of code with the durable/deterministic workflow Fiber scheduler off. This means fallback to default fiber scheduler and no workflow helpers will be available in the block. This is usually only needed in advanced situations where a third party library does something like use “Timeout” in a way that shouldn’t be made durable.
If this is invoked outside of a workflow, it just runs the block.
This implies illegal_call_tracing_disabled.
599 600 601 602 603 604 605 |
# File 'lib/temporalio/workflow.rb', line 599 def self.durable_scheduler_disabled(&) if Workflow.in_workflow? Workflow._current.durable_scheduler_disabled(&) else yield end end |
.illegal_call_tracing_disabled { ... } ⇒ Object
Run a block of code with illegal call tracing disabled. Users should be cautious about using this as it can often signify unsafe code.
If this is invoked outside of a workflow, it just runs the block.
570 571 572 573 574 575 576 |
# File 'lib/temporalio/workflow.rb', line 570 def self.illegal_call_tracing_disabled(&) if Workflow.in_workflow? Workflow._current.illegal_call_tracing_disabled(&) else yield end end |
.io_enabled ⇒ Object
Run a block of code with IO enabled. Specifically this allows the io_wait call of the fiber scheduler to work. Users should be cautious about using this as it can often signify unsafe code. Note, this is often only applicable to network code as file IO and most process-based IO does not go through scheduler io_wait.
If this is invoked outside of a workflow, it just runs the block.
583 584 585 586 587 588 589 |
# File 'lib/temporalio/workflow.rb', line 583 def self.io_enabled(&) if Workflow.in_workflow? Workflow._current.io_enabled(&) else yield end end |
.replaying? ⇒ Boolean
Returns True if the workflow is replaying (including during queries and update validators), false otherwise. Most code should not check this value.
552 553 554 |
# File 'lib/temporalio/workflow.rb', line 552 def self. Workflow._current. end |
.replaying_history_events? ⇒ Boolean
Returns True if the workflow is replaying history events (excluding queries and update validators), false otherwise. Most code should not check this value.
558 559 560 |
# File 'lib/temporalio/workflow.rb', line 558 def self. Workflow._current. end |