Class: SchwabRb::Stream::AsyncClient

Inherits:
Object
  • Object
show all
Defined in:
lib/schwab_rb/stream/async_client.rb

Instance Method Summary collapse

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

Returns:

  • (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

#startObject



17
18
19
# File 'lib/schwab_rb/stream/async_client.rb', line 17

def start
  @stream.start
end

#stopObject



21
22
23
# File 'lib/schwab_rb/stream/async_client.rb', line 21

def stop
  @stream.stop
end