Sha256: 83f1e8cb791b4f487f93831058ed04290114d80e1052b4d69726c9e174e566ed

Contents?: true

Size: 490 Bytes

Versions: 2

Compression:

Stored size: 490 Bytes

Contents

module Akephalos
  class RemoteClient
    @socket_file = "/tmp/akephalos.#{Process.pid}.sock"

    def self.start!
      remote_client = fork do
        exec("#{Akephalos::BIN_DIR + 'akephalos'} #{@socket_file}")
      end

      sleep 1 until File.exists?(@socket_file)

      at_exit { Process.kill(:INT, remote_client); File.unlink(@socket_file) }
    end

    def self.new
      start!
      DRb.start_service
      DRbObject.new_with_uri("drbunix://#{@socket_file}")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
akephalos-0.0.3 lib/akephalos/remote_client.rb
akephalos-0.0.2 lib/akephalos/remote_client.rb