Skip to content

Commit

Permalink
Remove block parameter from get_msg()
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Aug 3, 2021
1 parent 7a3abba commit f365a22
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions jupyter_client/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,12 @@ async def _recv(self, **kwargs) -> t.Dict[str, t.Any]:
ident, smsg = self.session.feed_identities(msg)
return self.session.deserialize(smsg)

async def get_msg(
self, block: bool = True, timeout: t.Optional[float] = None
) -> t.Dict[str, t.Any]:
async def get_msg(self, timeout: t.Optional[float] = None) -> t.Dict[str, t.Any]:
""" Gets a message if there is one that is ready. """
assert self.socket is not None
if block:
if timeout is not None:
timeout *= 1000 # seconds to ms
ready = await self.socket.poll(timeout)
else:
ready = await self.socket.poll(0)
if timeout is not None:
timeout *= 1000 # seconds to ms
ready = await self.socket.poll(timeout)

if ready:
res = await self._recv()
Expand Down

2 comments on commit f365a22

@tschaume
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin-bates breaks the get_msg call in kernel-gateway here

@kevin-bates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tschaume - Thanks for the heads-up and opening the issue in JKG. We'll address this instance JKG.

Please sign in to comment.