Class: SchwabRb::Stream::AsyncClient
- Inherits:
-
Object
- Object
- SchwabRb::Stream::AsyncClient
- Defined in:
- lib/schwab_rb/stream/async_client.rb
Instance Method Summary collapse
- #connected? ⇒ Boolean
-
#initialize(client) ⇒ AsyncClient
constructor
A new instance of AsyncClient.
- #on(service_symbol, symbols: nil, fields: nil, &block) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(client) ⇒ AsyncClient
Returns a new instance of AsyncClient.
8 9 10 |
# File 'lib/schwab_rb/stream/async_client.rb', line 8 def initialize(client) @stream = Base.new(client) end |
Instance Method Details
#connected? ⇒ Boolean
25 26 27 |
# File 'lib/schwab_rb/stream/async_client.rb', line 25 def connected? @stream.connected? end |
#on(service_symbol, symbols: nil, fields: nil, &block) ⇒ Object
12 13 14 15 |
# File 'lib/schwab_rb/stream/async_client.rb', line 12 def on(service_symbol, symbols: nil, fields: nil, &block) @stream.on(service_symbol, symbols: symbols, fields: fields, &block) self end |
#start ⇒ Object
17 18 19 |
# File 'lib/schwab_rb/stream/async_client.rb', line 17 def start @stream.start end |
#stop ⇒ Object
21 22 23 |
# File 'lib/schwab_rb/stream/async_client.rb', line 21 def stop @stream.stop end |