提交 2cbef699 编写于 作者: A Aaron Patterson

bind method is not needed, so goodbye! <3 <3 <3

上级 38703660
......@@ -65,7 +65,7 @@ def publish(*args)
end
def subscribe(pattern = nil, &block)
@queue.bind(pattern).subscribe(&block)
@queue.subscribe(pattern, &block)
end
def unsubscribe(subscriber)
......
......@@ -6,15 +6,9 @@ class Fanout
def initialize
@subscribers = []
@listeners_for = {}
@pattern = nil
end
def bind(pattern)
@pattern = pattern
self
end
def subscribe(pattern = @pattern, &block)
def subscribe(pattern = nil, &block)
@listeners_for.clear
@subscribers << Subscriber.new(pattern, &block)
@subscribers.last
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册