Sha256: cfc93b0581b30f1acb43b1bd01d543ed8a2a148db3641f58cfb61fbf6d5512c1

Contents?: true

Size: 561 Bytes

Versions: 16

Compression:

Stored size: 561 Bytes

Contents

require "drb"

module Tlapse
  class Server
    attr_accessor :host, :port

    def initialize(host: "localhost", port: 9000)
      @host = host
      @port = port
    end

    def serve
      DRb.start_service full_host, drb_object
      DRb.thread.join # wait for commands
    end

    def full_host
      "druby://#{@host}:#{@port}"
    end

    private ###################################################################

    def drb_object
      obj = Object.new
      obj.extend Tlapse::Doctor
      obj.extend Tlapse::Capture
      obj
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
tlapse-0.9.0 lib/tlapse/server.rb
tlapse-0.8.0 lib/tlapse/server.rb
tlapse-0.7.0 lib/tlapse/server.rb
tlapse-0.6.3 lib/tlapse/server.rb
tlapse-0.6.2 lib/tlapse/server.rb
tlapse-0.6.1 lib/tlapse/server.rb
tlapse-0.6.0 lib/tlapse/server.rb
tlapse-0.5.1 lib/tlapse/server.rb
tlapse-0.5.0 lib/tlapse/server.rb
tlapse-0.4.1 lib/tlapse/server.rb
tlapse-0.4.0 lib/tlapse/server.rb
tlapse-0.3.3 lib/tlapse/server.rb
tlapse-0.3.2 lib/tlapse/server.rb
tlapse-0.3.1 lib/tlapse/server.rb
tlapse-0.3.0 lib/tlapse/server.rb
tlapse-0.2.1 lib/tlapse/server.rb