Class: Orchestrator::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestrator/remote/proxy.rb

Constant Summary collapse

COMMANDS =
Set.new([:exec, :bind, :unbind, :debug, :ignore])

Instance Method Summary collapse

Constructor Details

#initialize(thread) ⇒ Proxy

Returns a new instance of Proxy.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/orchestrator/remote/proxy.rb', line 8

def initialize(thread)
    @thread = thread

    @accept_connection = method :accept_connection
    @new_connection =    method :new_connection
    @bind_error =        method :bind_error

    @shutdown = true
    @edge_nodes = ::ThreadSafe::Cache.new # id => connection
    @req_map    = {} # connection => ::Set.new (defers)
    @req_map    = {}

    @signal_bind   = @thread.async method(:bind_actual)
    @signal_unbind = @thread.async method(:unbind_actual)
end