Method: Thread::Channel#initialize
- Defined in:
- lib/thread/channel.rb
#initialize(messages = [], &block) ⇒ Channel
Create a channel with optional initial messages and optional channel guard.
19 20 21 22 23 24 25 26 27 |
# File 'lib/thread/channel.rb', line 19 def initialize( = [], &block) = [] @mutex = Mutex.new @check = block .each {|o| send o } end |