LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
685 stars 165 forks source link

ValueError: The future belongs to a different loop than the one specified as the loop argument #121

Closed oliver-zehentleitner closed 4 years ago

oliver-zehentleitner commented 4 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

What kind of internet connection do you have?

Average system load (CPU)

Hardware specification

Operating System? (include version)

Options

Python Version Requirement

Exact Python Version?

3.8.5

Pip Version?

Dependencies

UNICORN Binance WebSocket API Version?

Description of your issue

Exception in thread Thread-75:
Traceback (most recent call last):
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
line 932, in _bootstrap_inner
    self.run()
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/threading.py",
line 870, in run
    self._target(*self._args, **self._kwargs)
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py",
line 401, in _create_stream_thread
    loop.run_until_complete(socket.start_socket())
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py",
line 616, in run_until_complete
    return future.result()
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py",
line 109, in start_socket
    received_stream_data_json = await websocket.receive()
  File
"/Users/oliver/pycharmlocal/unicorn-binance-websocket-api/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py",
line 251, in receive
    received_data_json = await
self.manager.websocket_list[self.stream_id].recv()
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/websockets/protocol.py",
line 492, in recv
    await asyncio.wait(
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 424, in wait
    fs = {ensure_future(f, loop=loop) for f in set(fs)}
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 424, in <setcomp>
    fs = {ensure_future(f, loop=loop) for f in set(fs)}
  File
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/tasks.py",
line 667, in ensure_future
    raise ValueError('The future belongs to a different loop than '
ValueError: The future belongs to a different loop than the one
specified as the loop argument