Module: OMQ::Writable
- Includes:
- QueueWritable
- Defined in:
- lib/omq/writable.rb
Overview
Pure Ruby Writable mixin. Enqueues messages to the engine’s send path.
Constant Summary collapse
- EMPTY_PART =
"".b.freeze
Instance Method Summary collapse
-
#<<(message) ⇒ self
Sends a message (chainable).
-
#send(message) ⇒ self
Sends a message.
-
#wait_writable(timeout = @options.write_timeout) ⇒ true
Waits until the socket is writable.
Methods included from QueueWritable
Instance Method Details
#<<(message) ⇒ self
Sends a message (chainable).
37 38 39 |
# File 'lib/omq/writable.rb', line 37 def <<() send() end |
#send(message) ⇒ self
Sends a message.
21 22 23 24 25 26 27 28 29 |
# File 'lib/omq/writable.rb', line 21 def send() parts = () Reactor.run timeout: @options.write_timeout do |task| @engine.enqueue_send(parts) end self end |
#wait_writable(timeout = @options.write_timeout) ⇒ true
Waits until the socket is writable.
47 48 49 |
# File 'lib/omq/writable.rb', line 47 def wait_writable(timeout = @options.write_timeout) true end |