Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cassandra/io/asyncioreactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ def end(self):

def __init__(self, timeout, callback, loop):
delayed = self._call_delayed_coro(timeout=timeout,
callback=callback,
loop=loop)
callback=callback)
self._handle = asyncio.run_coroutine_threadsafe(delayed, loop=loop)

@staticmethod
async def _call_delayed_coro(timeout, callback, loop):
await asyncio.sleep(timeout, loop=loop)
async def _call_delayed_coro(timeout, callback):
await asyncio.sleep(timeout)
return callback()

def __lt__(self, other):
Expand Down Expand Up @@ -90,8 +89,8 @@ def __init__(self, *args, **kwargs):
self._connect_socket()
self._socket.setblocking(0)

self._write_queue = asyncio.Queue(loop=self._loop)
self._write_queue_lock = asyncio.Lock(loop=self._loop)
self._write_queue = asyncio.Queue()
self._write_queue_lock = asyncio.Lock()

# see initialize_reactor -- loop is running in a separate thread, so we
# have to use a threadsafe call
Expand Down