Sha256: 0269e26ffa1408c28efec67243cbede681d0f5b0dc9927d2f6592d74416eb3a5

Contents?: true

Size: 726 Bytes

Versions: 20

Compression:

Stored size: 726 Bytes

Contents

module Invoker
  module IPC
    class ClientHandler
      attr_accessor :client_socket
      def initialize(client_socket)
        @client_socket = client_socket
      end

      def read_and_execute
        client_handler, message_object = read_incoming_command
        client_socket.close if client_handler.run_command(message_object)
      rescue StandardError => error
        Invoker::Logger.puts error.message
        Invoker::Logger.puts error.backtrace
        client_socket.close
      end

      private

      def read_incoming_command
        message_object = Invoker::IPC.message_from_io(client_socket)
        [message_object.command_handler_klass.new(client_socket), message_object]
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 lib/invoker/ipc/client_handler.rb
itrg-invoker-1.6.0 lib/invoker/ipc/client_handler.rb
invoker-1.5.8 lib/invoker/ipc/client_handler.rb
invoker-1.5.7 lib/invoker/ipc/client_handler.rb
invoker-1.5.6 lib/invoker/ipc/client_handler.rb
invoker-1.5.5 lib/invoker/ipc/client_handler.rb
invoker-1.5.4 lib/invoker/ipc/client_handler.rb
invoker-1.5.3 lib/invoker/ipc/client_handler.rb
meepo-1.5.2 lib/invoker/ipc/client_handler.rb
invoker-1.5.1 lib/invoker/ipc/client_handler.rb
invoker-1.4.1 lib/invoker/ipc/client_handler.rb
invoker-1.4.0 lib/invoker/ipc/client_handler.rb
invoker-1.3.2 lib/invoker/ipc/client_handler.rb
invoker-1.3.1 lib/invoker/ipc/client_handler.rb
invoker-1.3.0 lib/invoker/ipc/client_handler.rb
invoker-1.2.0 lib/invoker/ipc/client_handler.rb
invoker-1.2.0.pre2 lib/invoker/ipc/client_handler.rb
invoker-1.2.0.pre1 lib/invoker/ipc/client_handler.rb
invoker-1.2.0.pre lib/invoker/ipc/client_handler.rb
invoker-1.1.0 lib/invoker/ipc/client_handler.rb