Module: ConcurrentPipeline::Processors::ActorProcessor::PipeActor::InstanceMethods

Defined in:
lib/concurrent_pipeline/processors/actor_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ctxObject

Returns the value of attribute ctx.



46
47
48
# File 'lib/concurrent_pipeline/processors/actor_processor.rb', line 46

def ctx
  @ctx
end

Instance Method Details

#replyObject



58
59
60
# File 'lib/concurrent_pipeline/processors/actor_processor.rb', line 58

def reply(...)
  ctx.reply(...)
end

#respond(msg) ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'lib/concurrent_pipeline/processors/actor_processor.rb', line 47

def respond(msg)
  if self.class.on_blocks.key?(msg.type)
    instance_exec(msg, &self.class.on_blocks[msg.type])
  else
    instance_exec(msg, &self.class.default_block)
  end
rescue => e
  Log.warn("error: #{e.class}:#{e.message}\n---\n#{e.backtrace.join("\n")}")
  terminate :error
end

#terminateObject



62
63
64
# File 'lib/concurrent_pipeline/processors/actor_processor.rb', line 62

def terminate(...)
  ctx.terminate(...)
end