class Sink::Multicast

Collects multiple sinks into a multicast group. Every input value of the multicast group is supplied to each of its members. When the multicast group is closed, all members are closed as well.

Public Class Methods

new(*receivers) click to toggle source
# File lib/coroutines/sink.rb, line 76
def initialize(*receivers)
        @receivers = receivers
end

Public Instance Methods

<<(obj) click to toggle source
# File lib/coroutines/sink.rb, line 79
def <<(obj)
        @receivers.each { |r| r << obj }
        self
end
close() click to toggle source
# File lib/coroutines/sink.rb, line 83
def close
        @receivers.each(&:close)
end