turbopipe 1.1.0__cp39-cp39-macosx_11_0_arm64.whl → 1.2.0__cp39-cp39-macosx_11_0_arm64.whl

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.

Potentially problematic release.


This version of turbopipe might be problematic. Click here for more details.

turbopipe/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Union
1
+ from typing import Optional, Union
2
2
 
3
3
  from moderngl import Buffer
4
4
 
@@ -7,8 +7,8 @@ from turbopipe import _turbopipe
7
7
 
8
8
  def pipe(buffer: Union[Buffer, memoryview], fileno: int) -> None:
9
9
  """
10
- Pipe the content of a moderngl.Buffer or memoryview to a file descriptor,
11
- Fast, threaded and non-blocking. Call `sync()` when done!
10
+ Pipe the content of a moderngl.Buffer or memoryview to a file descriptor, fast, threaded and
11
+ blocking when needed. Call `sync(buffer)` before this, and `sync()` when done for
12
12
 
13
13
  Usage:
14
14
  ```python
@@ -29,9 +29,12 @@ def pipe(buffer: Union[Buffer, memoryview], fileno: int) -> None:
29
29
  _turbopipe.pipe(buffer, fileno)
30
30
  del buffer
31
31
 
32
- def sync() -> None:
33
- """Waits for all jobs to finish"""
34
- _turbopipe.sync()
32
+ def sync(buffer: Optional[Union[Buffer, memoryview]]=None) -> None:
33
+ """Waits for any pending write operation on a buffer, or 'all buffers' if None, to finish"""
34
+ if isinstance(buffer, Buffer):
35
+ buffer = memoryview(buffer.mglo)
36
+ _turbopipe.sync(buffer)
37
+ del buffer
35
38
 
36
39
  def close() -> None:
37
40
  """Syncs and deletes objects"""
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: turbopipe
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: 🌀 Faster MemoryView inter-process data transfers for subprocesses
5
5
  Home-page: https://brokensrc.dev
6
6
  Author-Email: Tremeschin <29046864+Tremeschin@users.noreply.github.com>
@@ -0,0 +1,6 @@
1
+ turbopipe/_turbopipe.cpython-39-darwin.so,sha256=f9PwS4ntAf1-7IIyxfgdKMvuN89rIIg8yT6fUIGr6z4,76944
2
+ turbopipe/__init__.py,sha256=G5UDJHOgRTkf1viJAKRcsP8eud_2Mx5ToMC9qTqOYZ4,1299
3
+ turbopipe-1.2.0.dist-info/License.md,sha256=it5BPGKEP68XuUE54o2wVWR8NeWowkvb5dQO62UPeo8,1075
4
+ turbopipe-1.2.0.dist-info/RECORD,,
5
+ turbopipe-1.2.0.dist-info/WHEEL,sha256=rFEbl7VGpdcTiWMLyPHKRieKvxwiToMCxVXFuj50F_A,91
6
+ turbopipe-1.2.0.dist-info/METADATA,sha256=hqkixEychwBTMKxxYQ_4ycZaEpyObNyil6vJQt2pdrs,21716
@@ -1,6 +0,0 @@
1
- turbopipe/_turbopipe.cpython-39-darwin.so,sha256=zkHI59ow1dkrmepb198SowsxtMoR9CVoalr7trcyHoo,76768
2
- turbopipe/__init__.py,sha256=vDOOrpFDLHBpftUk1Jr-QoRd1lOLkhg-0kRvHUAyArk,1043
3
- turbopipe-1.1.0.dist-info/License.md,sha256=it5BPGKEP68XuUE54o2wVWR8NeWowkvb5dQO62UPeo8,1075
4
- turbopipe-1.1.0.dist-info/RECORD,,
5
- turbopipe-1.1.0.dist-info/WHEEL,sha256=rFEbl7VGpdcTiWMLyPHKRieKvxwiToMCxVXFuj50F_A,91
6
- turbopipe-1.1.0.dist-info/METADATA,sha256=lKFUmRKCCjpY1gaAG4_WuqTKoaUZFKN0JQeSIkfvlLg,21716