module RxIO::HandlerBase

Handler Base Module: Provides common abstractions to Service Handler implementations.

Public Instance Methods

buffer_input(endpoint, chunk) click to toggle source

Buffer Input Chunk: Writes a chunk of data to the endpoint's input buffer (:ibuf). @param [Hash] endpoint @param [String] chunk

# File lib/rxio/handler_base.rb, line 25
def buffer_input endpoint, chunk

        # Buffer Chunk
        endpoint[:ibuf] << chunk
end
write(endpoint, *data) click to toggle source

Write: Writes one or more chunks of data to the endpoint's output buffer (:obuf). @param [Hash] endpoint @param [String] data One or more chunks of data to be written to the ouput buffer

# 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