Class: PipeRpc::Gateway

Inherits:
Object show all
Defined in:
lib/pipe_rpc/gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Gateway



3
4
5
# File 'lib/pipe_rpc/gateway.rb', line 3

def initialize(args)
  @hub = Hub.new(args)
end

Instance Method Details

#channelObject



7
8
9
# File 'lib/pipe_rpc/gateway.rb', line 7

def channel
  @hub.channel
end

#clientsObject



15
16
17
# File 'lib/pipe_rpc/gateway.rb', line 15

def clients
  @hub.clients
end

#close(reason = 'manually closed') ⇒ Object



39
40
41
# File 'lib/pipe_rpc/gateway.rb', line 39

def close(reason = 'manually closed')
  @hub.socket.close(reason)
end

#handle_messageObject



43
44
45
# File 'lib/pipe_rpc/gateway.rb', line 43

def handle_message
  @hub.handle_message
end

#loop_iteration=(iteration) ⇒ Object



19
20
21
# File 'lib/pipe_rpc/gateway.rb', line 19

def loop_iteration=(iteration)
  @hub.requests.wait_for_results_through(iteration)
end

#off_received(on_received) ⇒ Object



35
36
37
# File 'lib/pipe_rpc/gateway.rb', line 35

def off_received(on_received)
  @hub.socket.off_received(on_received)
end

#off_sent(on_sent) ⇒ Object



27
28
29
# File 'lib/pipe_rpc/gateway.rb', line 27

def off_sent(on_sent)
  @hub.socket.off_sent(on_sent)
end

#on_received(&on_received) ⇒ Object



31
32
33
# File 'lib/pipe_rpc/gateway.rb', line 31

def on_received(&on_received)
  @hub.socket.on_received(&on_received)
end

#on_sent(&on_sent) ⇒ Object



23
24
25
# File 'lib/pipe_rpc/gateway.rb', line 23

def on_sent(&on_sent)
  @hub.socket.on_sent(&on_sent)
end

#serversObject



11
12
13
# File 'lib/pipe_rpc/gateway.rb', line 11

def servers
  @hub.servers
end