Class: Temporalio::Worker::Interceptor::Activity::Inbound

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) ⇒ Inbound

Initialize inbound with the next interceptor in the chain.

Parameters:

  • next_interceptor (Inbound)

    Next interceptor in the chain.



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

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.



33
34
35
# File 'lib/temporalio/worker/interceptor.rb', line 33

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.



56
57
58
# File 'lib/temporalio/worker/interceptor.rb', line 56

def execute(input)
  @next_interceptor.execute(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 activity interceptor.



47
48
49
# File 'lib/temporalio/worker/interceptor.rb', line 47

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