Sha256: a84dc4c5f98434ae279e8a378ce276fbbce1a9d426cf64555656e7f982ac9c49

Contents?: true

Size: 372 Bytes

Versions: 11

Compression:

Stored size: 372 Bytes

Contents

module Del
  class SocketServer
    def initialize(socket_file:)
      @connection = SocketConnection.new(path: socket_file)
    end

    def run(robot)
      loop do
        @connection.on_receive do |socket|
          line = socket.readline
          Del.logger.debug(line)
          socket.write(robot.execute(JSON.parse(line)))
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
del-0.1.16 lib/del/socket_server.rb
del-0.1.15 lib/del/socket_server.rb
del-0.1.14 lib/del/socket_server.rb
del-0.1.13 lib/del/socket_server.rb
del-0.1.12 lib/del/socket_server.rb
del-0.1.11 lib/del/socket_server.rb
del-0.1.10 lib/del/socket_server.rb
del-0.1.9 lib/del/socket_server.rb
del-0.1.8 lib/del/socket_server.rb
del-0.1.7 lib/del/socket_server.rb
del-0.1.6 lib/del/socket_server.rb