Class: Temporalio::Worker::Interceptor::Workflow::Inbound

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/worker/interceptor.rb

Overview

Inbound interceptor for intercepting inbound workflow calls. This should be extended by users needing to intercept workflows.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(next_interceptor) ⇒ Inbound

Initialize inbound with the next interceptor in the chain.

Parameters:

  • next_interceptor (Inbound)

    Next interceptor in the chain.



143
144
145
# File 'lib/temporalio/worker/interceptor.rb', line 143

def initialize(next_interceptor)
  @next_interceptor = next_interceptor
end

Instance Attribute Details

#next_interceptorInbound (readonly)

Returns Next interceptor in the chain.

Returns:

  • (Inbound)

    Next interceptor in the chain.



138
139
140
# File 'lib/temporalio/worker/interceptor.rb', line 138

def next_interceptor
  @next_interceptor
end

Instance Method Details

#execute(input) ⇒ Object

Execute a workflow and return result or raise exception. Next interceptor in chain (i.e. ‘super`) will perform the execution.

Parameters:

Returns:

  • (Object)

    Workflow result.



161
162
163
# File 'lib/temporalio/worker/interceptor.rb', line 161

def execute(input)
  @next_interceptor.execute(input)
end

#handle_query(input) ⇒ Object

Handle a workflow query and return result or raise exception. Next interceptor in chain (i.e. ‘super`) will perform the handling.

Parameters:

Returns:

  • (Object)

    Query result.



177
178
179
# File 'lib/temporalio/worker/interceptor.rb', line 177

def handle_query(input)
  @next_interceptor.handle_query(input)
end

#handle_signal(input) ⇒ Object

Handle a workflow signal. Next interceptor in chain (i.e. ‘super`) will perform the handling.

Parameters:



168
169
170
# File 'lib/temporalio/worker/interceptor.rb', line 168

def handle_signal(input)
  @next_interceptor.handle_signal(input)
end

#handle_update(input) ⇒ Object

Handle a workflow update and return result or raise exception. Next interceptor in chain (i.e. ‘super`) will perform the handling.

Parameters:

Returns:

  • (Object)

    Update result.



193
194
195
# File 'lib/temporalio/worker/interceptor.rb', line 193

def handle_update(input)
  @next_interceptor.handle_update(input)
end

#init(outbound) ⇒ Outbound

Initialize the outbound interceptor. This should be extended by users to return their own Outbound implementation that wraps the parameter here.

Parameters:

  • outbound (Outbound)

    Next outbound interceptor in the chain.

Returns:

  • (Outbound)

    Outbound workflow interceptor.



152
153
154
# File 'lib/temporalio/worker/interceptor.rb', line 152

def init(outbound)
  @next_interceptor.init(outbound)
end

#validate_update(input) ⇒ Object

Validate a workflow update. Next interceptor in chain (i.e. ‘super`) will perform the validation.

Parameters:



184
185
186
# File 'lib/temporalio/worker/interceptor.rb', line 184

def validate_update(input)
  @next_interceptor.validate_update(input)
end