Class: EventMachine::PosixMQ::Watcher
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- EventMachine::PosixMQ::Watcher
- Defined in:
- lib/em-posixmq.rb
Instance Method Summary collapse
-
#initialize(posix_mq) ⇒ Watcher
constructor
A new instance of Watcher.
- #notify_readable ⇒ Object
-
#receive_message(message, priority) ⇒ Object
This method must be defined in the user’s class inherinting this one.
Constructor Details
#initialize(posix_mq) ⇒ Watcher
Returns a new instance of Watcher.
11 12 13 14 |
# File 'lib/em-posixmq.rb', line 11 def initialize posix_mq @posix_mq = posix_mq @posix_mq.nonblock = true end |
Instance Method Details
#notify_readable ⇒ Object
16 17 18 19 20 |
# File 'lib/em-posixmq.rb', line 16 def notify_readable # POSIX_MQ#tryreceive returns nil in case there is nothing to read. , priority = @posix_mq.tryreceive , priority if end |
#receive_message(message, priority) ⇒ Object
This method must be defined in the user’s class inherinting this one.
23 24 25 |
# File 'lib/em-posixmq.rb', line 23 def , priority puts "EM::PosixMQ::Watcher#receive_message #{.inspect}, #{priority.inspect}" end |