Class: ASS::Topic
- Inherits:
-
Object
- Object
- ASS::Topic
- Defined in:
- lib/ass/topic.rb
Defined Under Namespace
Classes: Funnel
Class Method Summary collapse
- .event(name, key, data, opts = {}) ⇒ Object
- .funnel(tunnel_name, funnel_name, key_matcher, &block) ⇒ Object
- .tunnel(name, opts = {}) ⇒ Object
Class Method Details
.event(name, key, data, opts = {}) ⇒ Object
7 8 9 10 |
# File 'lib/ass/topic.rb', line 7 def event(name,key,data,opts={}) ASS.dummy_exchange(name).publish(ASS.serializer.dump(data), opts.merge(:routing_key => key)) end |
.funnel(tunnel_name, funnel_name, key_matcher, &block) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ass/topic.rb', line 12 def funnel(tunnel_name,funnel_name,key_matcher,&block) # actor should respond to on_event(key,data) funnel = Funnel.new(tunnel_name,funnel_name,key_matcher) if block funnel.react(&block) end funnel end |
.tunnel(name, opts = {}) ⇒ Object
3 4 5 |
# File 'lib/ass/topic.rb', line 3 def tunnel(name,opts={}) MQ.topic(name,opts) end |