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.



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

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.



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

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.



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

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.



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

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