portal 3.1.7__tar.gz → 3.1.8__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.
Files changed (35) hide show
  1. {portal-3.1.7/portal.egg-info → portal-3.1.8}/PKG-INFO +1 -1
  2. {portal-3.1.7 → portal-3.1.8}/portal/__init__.py +1 -1
  3. {portal-3.1.7 → portal-3.1.8}/portal/client.py +6 -21
  4. {portal-3.1.7 → portal-3.1.8/portal.egg-info}/PKG-INFO +1 -1
  5. {portal-3.1.7 → portal-3.1.8}/LICENSE +0 -0
  6. {portal-3.1.7 → portal-3.1.8}/MANIFEST.in +0 -0
  7. {portal-3.1.7 → portal-3.1.8}/README.md +0 -0
  8. {portal-3.1.7 → portal-3.1.8}/portal/batching.py +0 -0
  9. {portal-3.1.7 → portal-3.1.8}/portal/buffers.py +0 -0
  10. {portal-3.1.7 → portal-3.1.8}/portal/client_socket.py +0 -0
  11. {portal-3.1.7 → portal-3.1.8}/portal/contextlib.py +0 -0
  12. {portal-3.1.7 → portal-3.1.8}/portal/packlib.py +0 -0
  13. {portal-3.1.7 → portal-3.1.8}/portal/poollib.py +0 -0
  14. {portal-3.1.7 → portal-3.1.8}/portal/process.py +0 -0
  15. {portal-3.1.7 → portal-3.1.8}/portal/server.py +0 -0
  16. {portal-3.1.7 → portal-3.1.8}/portal/server_socket.py +0 -0
  17. {portal-3.1.7 → portal-3.1.8}/portal/sharray.py +0 -0
  18. {portal-3.1.7 → portal-3.1.8}/portal/thread.py +0 -0
  19. {portal-3.1.7 → portal-3.1.8}/portal/utils.py +0 -0
  20. {portal-3.1.7 → portal-3.1.8}/portal.egg-info/SOURCES.txt +0 -0
  21. {portal-3.1.7 → portal-3.1.8}/portal.egg-info/dependency_links.txt +0 -0
  22. {portal-3.1.7 → portal-3.1.8}/portal.egg-info/requires.txt +0 -0
  23. {portal-3.1.7 → portal-3.1.8}/portal.egg-info/top_level.txt +0 -0
  24. {portal-3.1.7 → portal-3.1.8}/pyproject.toml +0 -0
  25. {portal-3.1.7 → portal-3.1.8}/requirements.txt +0 -0
  26. {portal-3.1.7 → portal-3.1.8}/setup.cfg +0 -0
  27. {portal-3.1.7 → portal-3.1.8}/setup.py +0 -0
  28. {portal-3.1.7 → portal-3.1.8}/tests/test_batching.py +0 -0
  29. {portal-3.1.7 → portal-3.1.8}/tests/test_client.py +0 -0
  30. {portal-3.1.7 → portal-3.1.8}/tests/test_errfile.py +0 -0
  31. {portal-3.1.7 → portal-3.1.8}/tests/test_pack.py +0 -0
  32. {portal-3.1.7 → portal-3.1.8}/tests/test_process.py +0 -0
  33. {portal-3.1.7 → portal-3.1.8}/tests/test_server.py +0 -0
  34. {portal-3.1.7 → portal-3.1.8}/tests/test_socket.py +0 -0
  35. {portal-3.1.7 → portal-3.1.8}/tests/test_thread.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portal
3
- Version: 3.1.7
3
+ Version: 3.1.8
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
@@ -1,4 +1,4 @@
1
- __version__ = '3.1.7'
1
+ __version__ = '3.1.8'
2
2
 
3
3
  import multiprocessing as mp
4
4
  try:
@@ -106,34 +106,19 @@ class Client:
106
106
  reqnum = bytes(data[:8])
107
107
  status = int.from_bytes(data[8:16], 'little', signed=False)
108
108
  future = self.futures.pop(reqnum, None)
109
-
110
- assert future, (
111
- f'Unexpected request number: {reqnum}',
112
- sorted(self.futures.keys()))
113
-
114
- if status == 0:
109
+ if not future:
110
+ existing = sorted(self.futures.keys())
111
+ print(f'Unexpected request number: {reqnum}', existing)
112
+ elif status == 0:
115
113
  data = packlib.unpack(data[16:])
116
114
  future.set_result(data)
115
+ with self.cond: self.cond.notify_all()
117
116
  else:
118
117
  message = bytes(data[16:]).decode('utf-8')
119
118
  self._seterr(future, RuntimeError(message))
120
- with self.cond:
121
- self.cond.notify_all()
119
+ with self.cond: self.cond.notify_all()
122
120
  self.socket.recv()
123
121
 
124
- # if not future:
125
- # existing = sorted(self.futures.keys())
126
- # print(f'Unexpected request number: {reqnum}', existing)
127
- # elif status == 0:
128
- # data = packlib.unpack(data[16:])
129
- # future.set_result(data)
130
- # with self.cond: self.cond.notify_all()
131
- # else:
132
- # message = bytes(data[16:]).decode('utf-8')
133
- # self._seterr(future, RuntimeError(message))
134
- # with self.cond: self.cond.notify_all()
135
- # self.socket.recv()
136
-
137
122
  def _disc(self):
138
123
  if self.socket.options.autoconn:
139
124
  for future in list(self.futures.values()):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portal
3
- Version: 3.1.7
3
+ Version: 3.1.8
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes