Class: Eggplant::Channel

Inherits:
EventMachine::Channel
  • Object
show all
Defined in:
lib/eggplant/cli.rb

Instance Method Summary collapse

Instance Method Details

#push_except(name, *items) ⇒ Object

Add items to the channel, which are pushed out to all subscribers except ‘name`



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/eggplant/cli.rb', line 11

def push_except(name, *items)
  items = items.dup
  EM.schedule do
    items.each do |i|
      @subs.each do |key, value|
        if key != name
          value.call i
        end
      end
    end
  end
end