Class: HrrRbSsh::Connection::Channel::ChannelType::Session::ProcChain

Inherits:
Object
  • Object
show all
Defined in:
lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain.rb,
lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain/chain_context.rb

Defined Under Namespace

Classes: ChainContext

Instance Method Summary collapse

Constructor Details

#initializeProcChain

Returns a new instance of ProcChain.



13
14
15
16
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain.rb', line 13

def initialize
  @logger = Logger.new self.class.name
  @q = Queue.new
end

Instance Method Details

#call_next(*args) ⇒ Object



20
21
22
23
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain.rb', line 20

def call_next *args
  next_proc = @q.deq
  next_proc.call ChainContext.new(self), *args
end

#connect(next_proc) ⇒ Object



17
18
19
# File 'lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain.rb', line 17

def connect next_proc
  @q.enq next_proc if next_proc
end