portal 3.5.0__tar.gz → 3.6.0__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.5.0/portal.egg-info → portal-3.6.0}/PKG-INFO +2 -2
  2. {portal-3.5.0 → portal-3.6.0}/README.md +1 -1
  3. {portal-3.5.0 → portal-3.6.0}/portal/__init__.py +1 -1
  4. {portal-3.5.0 → portal-3.6.0}/portal/buffers.py +3 -3
  5. {portal-3.5.0 → portal-3.6.0}/portal/client_socket.py +4 -3
  6. {portal-3.5.0 → portal-3.6.0}/portal/server.py +2 -0
  7. {portal-3.5.0 → portal-3.6.0/portal.egg-info}/PKG-INFO +2 -2
  8. {portal-3.5.0 → portal-3.6.0}/LICENSE +0 -0
  9. {portal-3.5.0 → portal-3.6.0}/MANIFEST.in +0 -0
  10. {portal-3.5.0 → portal-3.6.0}/portal/batching.py +0 -0
  11. {portal-3.5.0 → portal-3.6.0}/portal/client.py +0 -0
  12. {portal-3.5.0 → portal-3.6.0}/portal/contextlib.py +0 -0
  13. {portal-3.5.0 → portal-3.6.0}/portal/packlib.py +0 -0
  14. {portal-3.5.0 → portal-3.6.0}/portal/poollib.py +0 -0
  15. {portal-3.5.0 → portal-3.6.0}/portal/process.py +0 -0
  16. {portal-3.5.0 → portal-3.6.0}/portal/server_socket.py +0 -0
  17. {portal-3.5.0 → portal-3.6.0}/portal/sharray.py +0 -0
  18. {portal-3.5.0 → portal-3.6.0}/portal/thread.py +0 -0
  19. {portal-3.5.0 → portal-3.6.0}/portal/utils.py +0 -0
  20. {portal-3.5.0 → portal-3.6.0}/portal.egg-info/SOURCES.txt +0 -0
  21. {portal-3.5.0 → portal-3.6.0}/portal.egg-info/dependency_links.txt +0 -0
  22. {portal-3.5.0 → portal-3.6.0}/portal.egg-info/requires.txt +0 -0
  23. {portal-3.5.0 → portal-3.6.0}/portal.egg-info/top_level.txt +0 -0
  24. {portal-3.5.0 → portal-3.6.0}/pyproject.toml +0 -0
  25. {portal-3.5.0 → portal-3.6.0}/requirements.txt +0 -0
  26. {portal-3.5.0 → portal-3.6.0}/setup.cfg +0 -0
  27. {portal-3.5.0 → portal-3.6.0}/setup.py +0 -0
  28. {portal-3.5.0 → portal-3.6.0}/tests/test_batching.py +0 -0
  29. {portal-3.5.0 → portal-3.6.0}/tests/test_client.py +0 -0
  30. {portal-3.5.0 → portal-3.6.0}/tests/test_errfile.py +0 -0
  31. {portal-3.5.0 → portal-3.6.0}/tests/test_pack.py +0 -0
  32. {portal-3.5.0 → portal-3.6.0}/tests/test_process.py +0 -0
  33. {portal-3.5.0 → portal-3.6.0}/tests/test_server.py +0 -0
  34. {portal-3.5.0 → portal-3.6.0}/tests/test_socket.py +0 -0
  35. {portal-3.5.0 → portal-3.6.0}/tests/test_thread.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portal
3
- Version: 3.5.0
3
+ Version: 3.6.0
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
@@ -58,7 +58,7 @@ def server():
58
58
 
59
59
  def client():
60
60
  import portal
61
- client = portal.Client('localhost', 2222)
61
+ client = portal.Client('localhost:2222')
62
62
  future = client.add(12, 42)
63
63
  result = future.result()
64
64
  print(result) # 54
@@ -45,7 +45,7 @@ def server():
45
45
 
46
46
  def client():
47
47
  import portal
48
- client = portal.Client('localhost', 2222)
48
+ client = portal.Client('localhost:2222')
49
49
  future = client.add(12, 42)
50
50
  result = future.result()
51
51
  print(result) # 54
@@ -1,4 +1,4 @@
1
- __version__ = '3.5.0'
1
+ __version__ = '3.6.0'
2
2
 
3
3
  import multiprocessing as mp
4
4
  try:
@@ -17,7 +17,7 @@ class SendBuffer:
17
17
  assert all(len(x) for x in buffers)
18
18
  assert 1 <= length, length
19
19
  assert not maxsize or length <= length, (length, maxsize)
20
- lenbuf = length.to_bytes(4, 'little', signed=False)
20
+ lenbuf = length.to_bytes(8, 'little', signed=False)
21
21
  self.buffers = [lenbuf, *buffers]
22
22
  self.remaining = collections.deque(self.buffers)
23
23
  self.pos = 0
@@ -64,10 +64,10 @@ class RecvBuffer:
64
64
 
65
65
  def recv(self, sock):
66
66
  if self.buffer is None:
67
- part = sock.recv(4 - len(self.lenbuf))
67
+ part = sock.recv(8 - len(self.lenbuf))
68
68
  self.lenbuf += part
69
69
  size = len(part)
70
- if len(self.lenbuf) == 4:
70
+ if len(self.lenbuf) == 8:
71
71
  length = int.from_bytes(self.lenbuf, 'little', signed=False)
72
72
  assert 1 <= length <= self.maxsize, (1, length, self.maxsize)
73
73
  # We use Numpy to allocate uninitialized memory because Python's
@@ -238,9 +238,10 @@ class ClientSocket:
238
238
  sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, after)
239
239
  sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, every)
240
240
  sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, fails)
241
- sock.setsockopt(
242
- socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT,
243
- 1000 * (after + every * fails))
241
+ if hasattr(socket, 'TCP_USER_TIMEOUT'): # Linux
242
+ sock.setsockopt(
243
+ socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT,
244
+ 1000 * (after + every * fails))
244
245
  if sys.platform == 'darwin':
245
246
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
246
247
  sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPALIVE, every)
@@ -168,3 +168,5 @@ class Server:
168
168
  # Wait until the error is delivered to the client and then raise.
169
169
  self.close(internal=True)
170
170
  raise RuntimeError(message)
171
+ else:
172
+ print(f'Error in server method: {message}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: portal
3
- Version: 3.5.0
3
+ Version: 3.6.0
4
4
  Summary: Fast and reliable distributed systems in Python
5
5
  Home-page: http://github.com/danijar/portal
6
6
  Author: Danijar Hafner
@@ -58,7 +58,7 @@ def server():
58
58
 
59
59
  def client():
60
60
  import portal
61
- client = portal.Client('localhost', 2222)
61
+ client = portal.Client('localhost:2222')
62
62
  future = client.add(12, 42)
63
63
  result = future.result()
64
64
  print(result) # 54
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