grpclib
grpclib copied to clipboard
Allow Channel objects to be created outside of async contexts
Fixes #161
Is it expected that people will want to re-use channels? In that case this will cause errors if someone tries to re-use it. In that case we should use an ephemeral _loop
in _create_connection
rather than setting it as a field.
Is it expected that people will want to re-use channels? In that case this will cause errors if someone tries to re-use it. In that case we should use an ephemeral _loop in _create_connection rather than setting it as a field.
I think that the whole point in removing loop
argument in all public-facing APIs in asyncio
and here in grpclib
is to assume that we always use implicitly one global event-loop to greatly simplify API.
Only in tests I know that this is not true and now also in your example with IPython.
Your PR LGTM, only mypy
has some concerns.