Sha256: 5b7f110a62179e0cbf28b2c4a28fce9beba5a83e05ef7326d7fe97754d880d0e

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

module Packet
  class Pimp
    include NbioHelper
    extend Forwardable
    iattr_accessor :pimp_name
    attr_accessor :lifeline, :pid, :signature
    attr_accessor :fd_write_end
    attr_accessor :workers, :reactor

    def initialize(lifeline_socket,worker_pid,p_reactor)
      @lifeline = lifeline_socket
      @pid = worker_pid
      @reactor = p_reactor
      @signature = Guid.hexdigest
      pimp_init if self.respond_to?(:pimp_init)
    end

    # encode the data, before writing to the socket
    def send_data p_data
      dump_object(p_data,@lifeline)
    end

    def send_fd sock_fd
      @fd_write_end.send_io(sock_fd)
    end

    alias_method :do_work, :send_data
    def_delegators :@reactor, :connections
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
packet-0.1.0 lib/pimp.rb