Skip to content

Commit

Permalink
Lazy initialization of loop in client
Browse files Browse the repository at this point in the history
  • Loading branch information
habibutsu committed Jun 3, 2016
1 parent b5aeab4 commit 4888b43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nats/aio/client.py
Expand Up @@ -128,7 +128,7 @@ def __init__(self):
@asyncio.coroutine
def connect(self,
servers=["nats://127.0.0.1:4222"],
io_loop=asyncio.get_event_loop(),
io_loop=None,
error_cb=None,
disconnected_cb=None,
closed_cb=None,
Expand All @@ -143,7 +143,7 @@ def connect(self,
max_outstanding_pings=DEFAULT_MAX_OUTSTANDING_PINGS,
dont_randomize=False):
self._setup_server_pool(servers)
self._loop = io_loop
self._loop = io_loop or asyncio.get_event_loop()
self._error_cb = error_cb
self._closed_cb = closed_cb
self._reconnected_cb = reconnected_cb
Expand Down

0 comments on commit 4888b43

Please sign in to comment.