Module: RxIO::HandlerBase
- Defined in:
- lib/rxio/handler_base.rb
Overview
Handler Base Module: Provides common abstractions to Service Handler implementations.
Instance Method Summary collapse
-
#buffer_input(endpoint, chunk) ⇒ Object
Buffer Input Chunk: Writes a chunk of data to the endpoint’s input buffer (:ibuf).
-
#write(endpoint, *data) ⇒ Object
Write: Writes one or more chunks of data to the endpoint’s output buffer (:obuf).
Instance Method Details
#buffer_input(endpoint, chunk) ⇒ Object
Buffer Input Chunk: Writes a chunk of data to the endpoint’s input buffer (:ibuf).
25 26 27 28 29 |
# File 'lib/rxio/handler_base.rb', line 25 def buffer_input endpoint, chunk # Buffer Chunk endpoint[:ibuf] << chunk end |
#write(endpoint, *data) ⇒ Object
Write: Writes one or more chunks of data to the endpoint’s output buffer (:obuf).
15 16 17 18 19 |
# File 'lib/rxio/handler_base.rb', line 15 def write endpoint, *data # Add Data Chunks to Buffer data.each { |c| endpoint[:lock].synchronize { endpoint[:obuf] << c.to_s } } end |