module PipeRpc class Gateway def initialize(channels) @hub = Hub.new(self, channels) @client_wrapper_class_namespace = ClientWrappers @subject_server_class_namespace = SubjectServers end attr_accessor :client_wrapper_class_namespace, :subject_server_class_namespace def channel @hub.channel end def servers @hub.servers end def clients @hub.clients end def loop_iteration=(iteration) @hub.requests.wait_for_results_through(iteration) end def handle_message @hub.handle_message end def on_sent(&on_sent) @hub.socket.on_sent(&on_sent) end def off_sent(on_sent) @hub.socket.off_sent(on_sent) end def on_received(&on_received) @hub.socket.on_received(&on_received) end def off_received(on_received) @hub.socket.off_received(on_received) end def close(reason = 'manually closed') @hub.socket.close(reason) end end end