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

Use asyncio for TCP/TLS comms #5450

Merged
merged 16 commits into from
Dec 10, 2021
16 changes: 15 additions & 1 deletion distributed/comm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@
unparse_host_port,
)
from .core import Comm, CommClosedError, connect, listen
from .registry import backends
from .utils import get_tcp_server_address, get_tcp_server_addresses


def _register_transports():
from . import inproc, tcp, ws
import os

from . import asyncio_tcp, inproc, tcp, ws

if os.getenv("DISTRIBUTED_USE_ASYNCIO_FOR_TCP", "").lower() not in (
"",
"0",
"false",
):
backends["tcp"] = asyncio_tcp.TCPBackend()
backends["tls"] = asyncio_tcp.TLSBackend()
else:
backends["tcp"] = tcp.TCPBackend()
backends["tls"] = tcp.TLSBackend()

try:
from . import ucx
Expand Down
Loading