Sha256: f7c4b43fa778b50cc2cdc94ecd99358a700dd0f18c9734e2f41e49c872fe6541

Contents?: true

Size: 624 Bytes

Versions: 37

Compression:

Stored size: 624 Bytes

Contents

module EventMachine
  module Protocols
    # LineProtocol will parse out newline terminated strings from a receive_data stream
    #
    #  module Server
    #    include EM::P::LineProtocol
    #
    #    def receive_line(line)
    #      send_data("you said: #{line}")
    #    end
    #  end
    #
    module LineProtocol
      # @private
      def receive_data data
        (@buf ||= '') << data

        while line = @buf.slice!(/(.*)\r?\n/)
          receive_line(line)
        end
      end

      # Invoked with lines received over the network
      def receive_line(line)
        # stub
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
sonixlabs-eventmachine-java-1.0.0.rc.7-java lib/em/protocols/line_protocol.rb
eventmachine-1.0.1-x86-mswin32-60 lib/em/protocols/line_protocol.rb
eventmachine-1.0.1-x86-mingw32 lib/em/protocols/line_protocol.rb
eventmachine-1.0.1-java lib/em/protocols/line_protocol.rb
eventmachine-1.0.1 lib/em/protocols/line_protocol.rb
eventmachine-maglev--1.0.0 lib/em/protocols/line_protocol.rb
sonixlabs-eventmachine-java-1.0.0.rc.5-java lib/em/protocols/line_protocol.rb
sonixlabs-eventmachine-java-1.0.0.rc.4-java lib/em/protocols/line_protocol.rb
eventmachine-1.0.0-java lib/em/protocols/line_protocol.rb
eventmachine-1.0.0-x86-mingw32 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0-x86-mswin32-60 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0 lib/em/protocols/line_protocol.rb
eventmachine-maglev--1.0.0.rc.4 lib/em/protocols/line_protocol.rb
eventmachine-maglev--1.0.0.beta.4 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.4-java lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.4 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.4-x86-mswin32-60 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.4-x86-mingw32 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.3 lib/em/protocols/line_protocol.rb
eventmachine-1.0.0.rc.3-x86-mswin32-60 lib/em/protocols/line_protocol.rb