Class: Restate::SendHandle
- Inherits:
-
Object
- Object
- Restate::SendHandle
- Defined in:
- lib/restate/durable_future.rb
Overview
A handle for fire-and-forget send operations. Returned by ctx.service_send, ctx.object_send, ctx.workflow_send.
Instance Method Summary collapse
-
#cancel ⇒ Object
Cancel the remote invocation.
-
#initialize(ctx, invocation_id_handle) ⇒ SendHandle
constructor
A new instance of SendHandle.
-
#invocation_id ⇒ String
Returns the invocation ID of the sent call.
Constructor Details
#initialize(ctx, invocation_id_handle) ⇒ SendHandle
Returns a new instance of SendHandle.
84 85 86 87 88 89 |
# File 'lib/restate/durable_future.rb', line 84 def initialize(ctx, invocation_id_handle) @ctx = ctx @invocation_id_handle = invocation_id_handle @invocation_id_resolved = false @invocation_id_value = nil end |
Instance Method Details
#cancel ⇒ Object
Cancel the remote invocation.
103 104 105 |
# File 'lib/restate/durable_future.rb', line 103 def cancel @ctx.cancel_invocation(invocation_id) end |
#invocation_id ⇒ String
Returns the invocation ID of the sent call. Lazily resolved.
94 95 96 97 98 99 100 |
# File 'lib/restate/durable_future.rb', line 94 def invocation_id unless @invocation_id_resolved @invocation_id_value = @ctx.resolve_handle(@invocation_id_handle) @invocation_id_resolved = true end @invocation_id_value end |