Class: DRb::WebSocket::CallbackServer
- Inherits:
-
Object
- Object
- DRb::WebSocket::CallbackServer
- Defined in:
- lib/drb/websocket/callback_server.rb
Defined Under Namespace
Classes: ServerSide
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #accept ⇒ Object
- #close ⇒ Object
-
#initialize(uri, config) ⇒ CallbackServer
constructor
A new instance of CallbackServer.
- #reconnect ⇒ Object
Constructor Details
#initialize(uri, config) ⇒ CallbackServer
Returns a new instance of CallbackServer.
6 7 8 9 10 11 |
# File 'lib/drb/websocket/callback_server.rb', line 6 def initialize(uri, config) @uri = uri @config = config @queue = Thread::Queue.new reconnect end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
4 5 6 |
# File 'lib/drb/websocket/callback_server.rb', line 4 def uri @uri end |
Instance Method Details
#accept ⇒ Object
30 31 32 33 34 35 |
# File 'lib/drb/websocket/callback_server.rb', line 30 def accept (sender_id, ) = @queue.pop server_side = ServerSide.new(@wsclient, sender_id, , @config, @uri) reconnect server_side end |
#close ⇒ Object
23 24 25 26 27 28 |
# File 'lib/drb/websocket/callback_server.rb', line 23 def close EM.defer do @wsclient.close @wsclient = nil end end |