Class: MicroQ::Middleware::Chain
- Inherits:
-
Object
- Object
- MicroQ::Middleware::Chain
- Defined in:
- lib/micro_q/middleware/chain.rb
Overview
An Array wrapper that holds the class name of middlewares to call around the execution of messages. The most basic middleware must yield to the given block to allow the message to be invoked. Not yielding causes the message to be dropped and not invoked.
A minimal middleware: class MyFunMiddleware
def call(worker, )
# Do something fun here ...
yield
# More fun goes here ...
end
end
Defined Under Namespace
Instance Method Summary collapse
-
#client ⇒ Object
Middleware chain that is run around message push.
-
#server ⇒ Object
Middleware chain that is run around execution of messages.
Instance Method Details
#client ⇒ Object
Middleware chain that is run around message push.
-- If halted, the will not enter the queue.
38 39 40 |
# File 'lib/micro_q/middleware/chain.rb', line 38 def client @client ||= Client.new end |
#server ⇒ Object
Middleware chain that is run around execution of messages.
-- If halted, the will not be invoked.
30 31 32 |
# File 'lib/micro_q/middleware/chain.rb', line 30 def server @server ||= Server.new end |