Class: Temporalio::Worker::Interceptor::ActivityInbound

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(next_interceptor) ⇒ ActivityInbound

Initialize inbound with the next interceptor in the chain.

Parameters:



43
44
45
# File 'lib/temporalio/worker/interceptor.rb', line 43

def initialize(next_interceptor)
  @next_interceptor = next_interceptor
end

Instance Attribute Details

#next_interceptorActivityInbound (readonly)

Returns Next interceptor in the chain.

Returns:



38
39
40
# File 'lib/temporalio/worker/interceptor.rb', line 38

def next_interceptor
  @next_interceptor
end

Instance Method Details

#execute(input) ⇒ Object

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

Parameters:

Returns:

  • (Object)

    Activity result.



61
62
63
# File 'lib/temporalio/worker/interceptor.rb', line 61

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

#init(outbound) ⇒ ActivityOutbound

Initialize the outbound interceptor. This should be extended by users to return their own Temporalio::Worker::Interceptor::ActivityOutbound implementation that wraps the parameter here.

Parameters:

Returns:



52
53
54
# File 'lib/temporalio/worker/interceptor.rb', line 52

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