conkernelclient 0.0.11__tar.gz → 0.0.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conkernelclient
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Concurrent-safe Jupyter KernelClient
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -0,0 +1,2 @@
1
+ __version__ = "0.0.12"
2
+ from .core import *
@@ -32,12 +32,17 @@ def _send(self, stream, msg_or_type, content=None, parent=None, ident=None,
32
32
  buffers=None, track=False, header=None, metadata=None):
33
33
  msg = self._orig_send(stream, msg_or_type, content=content, parent=parent,
34
34
  ident=ident, buffers=buffers, track=track, header=header, metadata=metadata)
35
- # Force a sync, ensuring the send is fully registered internally
36
- # Avoids a race where the lock releases, another thread immediately calls send(),
37
- # and now 2 threads are interacting with the internal state before I/O thread has caught up
35
+ # Session.send sends via a SYNC shadow of the asyncio socket (zmq.Socket.shadow), which runs
36
+ # libzmq process_commands() and consumes the FD edge a buffered reply may have signalled —
37
+ # a recv parked in poll(None) on that edge would then sleep forever. Reading EVENTS through
38
+ # the async override (_AsyncSocket.get) makes pyzmq re-schedule _handle_events for pending
39
+ # recv/poll futures, compensating the consumed edge. It MUST be .get(): pyzmq aliases
40
+ # `getsockopt = SocketBase.get` at class level, so .getsockopt() bypasses the override
41
+ # and consumes the edge without rescheduling.
38
42
  if stream:
39
43
  if hasattr(stream, 'io_thread'): stream.io_thread.socket.get(zmq.EVENTS)
40
- elif hasattr(stream, 'getsockopt'): stream.getsockopt(zmq.EVENTS)
44
+ # See tests/zmq_regression.py for a regression test which fails is 'get' is switched to 'getsockopt'
45
+ elif hasattr(stream, 'get'): stream.get(zmq.EVENTS)
41
46
  return msg
42
47
 
43
48
  Session.send = _send
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conkernelclient
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Concurrent-safe Jupyter KernelClient
5
5
  Author-email: Jeremy Howard <github@jhoward.fastmail.fm>
6
6
  License: Apache-2.0
@@ -1,2 +0,0 @@
1
- __version__ = "0.0.11"
2
- from .core import *