Class: IGMarkets::CLI::Stream
- Inherits:
-
Thor
- Object
- Thor
- IGMarkets::CLI::Stream
- Defined in:
- lib/ig_markets/cli/commands/stream_command.rb
Overview
Implements the ‘ig_markets stream` command.
Instance Method Summary collapse
Instance Method Details
#dashboard ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ig_markets/cli/commands/stream_command.rb', line 9 def dashboard Main.begin_session() do |dealing_platform| dealing_platform.streaming.connect dealing_platform.streaming.on_error { |error| @error = error } window = CursesWindow.new account_state = Streaming::AccountState.new dealing_platform account_state.start redraw_account_state account_state, window until @error raise @error end end |
#raw ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ig_markets/cli/commands/stream_command.rb', line 34 def raw Main.begin_session() do |dealing_platform| @dealing_platform = dealing_platform @queue = Queue.new @dealing_platform.streaming.on_error { |error| on_error error } @dealing_platform.streaming.connect start_raw_subscriptions main_loop end end |