Class: Polyphony::Channel

Inherits:
Queue show all
Defined in:
lib/polyphony/core/channel.rb

Overview

Implements a unidirectional communication channel along the lines of Go (buffered) channels.

Instance Method Summary collapse

Methods inherited from Queue

#<<, #cap, #capped?, #clear, #closed?, #delete, #deq, #empty?, #enq, #flush_waiters, #initialize, #length, #num_waiting, #pending?, #pop, #push, #shift, #shift_all, #shift_each, #size, #unshift

Constructor Details

This class inherits a constructor from Polyphony::Queue

Instance Method Details

#closeObject

Closes the channel, resuming any fibers waiting on the channel with a Polyphony::MoveOn exception



13
14
15
# File 'lib/polyphony/core/channel.rb', line 13

def close
  flush_waiters(Polyphony::MoveOn.new)
end