Module: Hubeye::Server

Includes:
Helpers::Time
Included in:
HubeyeServer
Defined in:
lib/server/hubeye_server.rb

Defined Under Namespace

Classes: Session, Strategy

Constant Summary collapse

CONFIG_FILE =
File.join(ENV['HOME'], ".hubeye", "hubeyerc")
CONFIG =
{}

Constants included from Helpers::Time

Helpers::Time::NOW

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#daemonizedObject (readonly)

Returns the value of attribute daemonized.



50
51
52
# File 'lib/server/hubeye_server.rb', line 50

def daemonized
  @daemonized
end

#remote_connectionObject

Returns the value of attribute remote_connection.



49
50
51
# File 'lib/server/hubeye_server.rb', line 49

def remote_connection
  @remote_connection
end

#sessionObject (readonly)

Returns the value of attribute session.



50
51
52
# File 'lib/server/hubeye_server.rb', line 50

def session
  @session
end

#socketObject (readonly)

Returns the value of attribute socket.



50
51
52
# File 'lib/server/hubeye_server.rb', line 50

def socket
  @socket
end

#socketsObject (readonly)

Returns the value of attribute sockets.



50
51
52
# File 'lib/server/hubeye_server.rb', line 50

def sockets
  @sockets
end

Instance Method Details

#start(port, options = {}) ⇒ Object

end of Session class



536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/server/hubeye_server.rb', line 536

def start(port, options={})
  listen(port)
  setup_env(options)
  loop do
    waiting = catch(:connect) do
      look_for_changes unless @remote_connection
    end
    client_connect(@sockets) if waiting
    catch(:invalid_input) do
      strategy = Strategy.new(self)
      strategy.call
    end
    @session.cleanup
  end
end