Class: PipeRpc::Gateway

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channels) ⇒ Gateway

Returns a new instance of Gateway.



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

def initialize(channels)
  @hub = Hub.new(self, channels)
  @client_wrapper_class_namespace = ClientWrappers
  @subject_server_class_namespace = SubjectServers
end

Instance Attribute Details

#client_wrapper_class_namespaceObject

Returns the value of attribute client_wrapper_class_namespace.



9
10
11
# File 'lib/pipe_rpc/gateway.rb', line 9

def client_wrapper_class_namespace
  @client_wrapper_class_namespace
end

#subject_server_class_namespaceObject

Returns the value of attribute subject_server_class_namespace.



9
10
11
# File 'lib/pipe_rpc/gateway.rb', line 9

def subject_server_class_namespace
  @subject_server_class_namespace
end

Instance Method Details

#channelObject



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

def channel
  @hub.channel
end

#clientsObject



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

def clients
  @hub.clients
end

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



47
48
49
# File 'lib/pipe_rpc/gateway.rb', line 47

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

#handle_messageObject



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

def handle_message
  @hub.handle_message
end

#loop_iteration=(iteration) ⇒ Object



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

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

#off_received(on_received) ⇒ Object



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

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

#off_sent(on_sent) ⇒ Object



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

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

#on_received(&on_received) ⇒ Object



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

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

#on_sent(&on_sent) ⇒ Object



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

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

#serversObject



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

def servers
  @hub.servers
end