Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Feb 23, 2022
1 parent 81e10a0 commit 6b4b0b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ async def _flush_control_queue(self):
control_loop = self.io_loop
tracer_future = awaitable_future = asyncio.Future()

def _flush():
async def _flush():
# control_stream.flush puts messages on the queue
self.control_stream.flush()
# put Future on the queue after all of those,
# so we can wait for all queued messages to be processed
self.control_queue.put(tracer_future)
await self.control_queue.put(tracer_future)

control_loop.call_soon_threadsafe(_flush)
asyncio.run_coroutine_threadsafe(_flush(), control_loop)
return awaitable_future

async def process_control(self, msg):
Expand Down

0 comments on commit 6b4b0b5

Please sign in to comment.