Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to connect from another process #1031

Open
Drake1804 opened this issue Apr 30, 2024 · 0 comments
Open

Fail to connect from another process #1031

Drake1804 opened this issue Apr 30, 2024 · 0 comments
Labels

Comments

@Drake1804
Copy link

I want to start my script in a separate process. And Cryptofeed is a part of this new process.

p = multiprocessing.Process(target=init_app)
p.start()

but cryptofeed fails by a timeout:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection_handler.py", line 59, in _create_connection
    async with self.conn.connect() as connection:
  File "/usr/local/lib/python3.9/contextlib.py", line 181, in __aenter__
    return await self.gen.__anext__()
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection.py", line 104, in connect
    await self._open()
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection.py", line 318, in _open
    self.conn = await websockets.connect(self.address, **self.ws_kwargs)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
    return await self.__await_impl__()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 169, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
    raise asyncio.TimeoutError

I've checked with the websocket-client it establishes a connection without any issues. Am I missing something to make it work?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant