You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/newenv/lib/python3.12/site-packages/schwabdev/stream.py:219, in Stream.send(self, requests)
213 """
214 Send a request to the stream
215 :param requests: list of requests or a single request
216 :type requests: list | dict
217 """
218 # send the request using the async function
--> 219 asyncio.run(self.send_async(requests))
File /usr/lib/python3.12/asyncio/runners.py:190, in run(main, debug, loop_factory)
161 """Execute the coroutine and return the result.
162
163 This function runs the passed coroutine, taking care of
(...)
186 asyncio.run(main())
187 """
188 if events._get_running_loop() is not None:
189 # fail fast with short traceback
--> 190 raise RuntimeError(
191 "asyncio.run() cannot be called from a running event loop")
193 with Runner(debug=debug, loop_factory=loop_factory) as runner:
194 return runner.run(main)
RuntimeError: asyncio.run() cannot be called from a running event loop
INFO:Schwabdev.Stream:Connected to streaming server.
ERROR:Schwabdev.Stream:no close frame received or sent
WARNING:Schwabdev.Stream:Stream has crashed within 90 seconds, likely no subscriptions, invalid login, or lost connection (not restarting).
The text was updated successfully, but these errors were encountered:
The streamer is not really designed to be used in a notebook (even though it is in the example). I will be looking into this over the next couple days.
Running Jupiter notebook example for "Streaming Example" in jupyter_demo.ipynb, I get the error below. I think asyncio library is needed?
INFO:Schwabdev.Stream:Connecting to streaming server...
RuntimeError Traceback (most recent call last)
Cell In[10], line 3
1 #start stream and send request
2 streamer.start(add_to_list)
----> 3 streamer.send(streamer.level_one_equities("AMD", "0,1,2,3,4,5,6,7,8"))
File ~/newenv/lib/python3.12/site-packages/schwabdev/stream.py:219, in Stream.send(self, requests)
213 """
214 Send a request to the stream
215 :param requests: list of requests or a single request
216 :type requests: list | dict
217 """
218 # send the request using the async function
--> 219 asyncio.run(self.send_async(requests))
File /usr/lib/python3.12/asyncio/runners.py:190, in run(main, debug, loop_factory)
161 """Execute the coroutine and return the result.
162
163 This function runs the passed coroutine, taking care of
(...)
186 asyncio.run(main())
187 """
188 if events._get_running_loop() is not None:
189 # fail fast with short traceback
--> 190 raise RuntimeError(
191 "asyncio.run() cannot be called from a running event loop")
193 with Runner(debug=debug, loop_factory=loop_factory) as runner:
194 return runner.run(main)
RuntimeError: asyncio.run() cannot be called from a running event loop
INFO:Schwabdev.Stream:Connected to streaming server.
ERROR:Schwabdev.Stream:no close frame received or sent
WARNING:Schwabdev.Stream:Stream has crashed within 90 seconds, likely no subscriptions, invalid login, or lost connection (not restarting).
The text was updated successfully, but these errors were encountered: