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
Constructor Details
#initialize(posix_mq) ⇒ Watcher
Returns a new instance of Watcher.
10 11 12 13 |
# File 'lib/em-posixmq.rb', line 10 def initialize(posix_mq) @posix_mq = posix_mq @posix_mq.nonblock = true end |
Instance Method Details
#notify_readable ⇒ Object
15 16 17 18 19 |
# File 'lib/em-posixmq.rb', line 15 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
21 22 23 |
# File 'lib/em-posixmq.rb', line 21 def (, priority) # This method must be defined in the user's class inherinting this one. end |