Class: AnyCable::Rack::RPC::Client
- Inherits:
-
Object
- Object
- AnyCable::Rack::RPC::Client
- Defined in:
- lib/anycable/rack/rpc/client.rb
Overview
AnyCable RPC client
Instance Attribute Summary collapse
-
#stub ⇒ Object
readonly
Returns the value of attribute stub.
Instance Method Summary collapse
- #command(command:, identifier:, connection_identifiers:, data:) ⇒ Object
- #connect(headers:, path:) ⇒ Object
- #disconnect(identifiers:, subscriptions:, headers:, path:) ⇒ Object
-
#initialize(host) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Attribute Details
#stub ⇒ Object (readonly)
Returns the value of attribute stub.
10 11 12 |
# File 'lib/anycable/rack/rpc/client.rb', line 10 def stub @stub end |
Instance Method Details
#command(command:, identifier:, connection_identifiers:, data:) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/anycable/rack/rpc/client.rb', line 21 def command(command:, identifier:, connection_identifiers:, data:) = CommandMessage.new( command: command, identifier: identifier, connection_identifiers: connection_identifiers, data: data ) stub.command() end |
#connect(headers:, path:) ⇒ Object
16 17 18 19 |
# File 'lib/anycable/rack/rpc/client.rb', line 16 def connect(headers:, path:) request = ConnectionRequest.new(headers: headers, path: path) stub.connect(request) end |
#disconnect(identifiers:, subscriptions:, headers:, path:) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/anycable/rack/rpc/client.rb', line 31 def disconnect(identifiers:, subscriptions:, headers:, path:) request = DisconnectRequest.new( identifiers: identifiers, subscriptions: subscriptions, headers: headers, path: path ) stub.disconnect(request) end |