Commit Graph

10 Commits (2d15b6bfb1ae4bde811ae7889e6dceaccc1faca7)

Author SHA1 Message Date
Guillermo Rodriguez 2d15b6bfb1
Add direct read method on EventFD
Type hint all ctx managers in _ringbuf.py
Remove unnecesary send lock on ring chan sender
Handle EOF on ring chan receiver
Rename ringbuf tests to make it less redundant
2025-03-22 16:39:43 -03:00
Guillermo Rodriguez 368e3ec34c
Improve test_ringbuf test, drop MsgTransport ring buf impl for now in favour of a trio.abc.Channel[bytes] impl, add docstrings 2025-03-22 16:39:43 -03:00
Guillermo Rodriguez 40ce518f1f
Switch `tractor.ipc.MsgTransport.stream` type to `trio.abc.Stream`
Add EOF signaling mechanism
Support proper `receive_some` end of stream semantics
Add StapledStream non-ipc test
Create MsgpackRBStream similar to MsgpackTCPStream for buffered whole-msg reads
Add EventFD.read cancellation on EventFD.close mechanism using cancel scope
Add test for eventfd cancellation
Improve and add docstrings
2025-03-22 16:39:43 -03:00
Guillermo Rodriguez 315e850598
Better encapsulate RingBuff ctx managment methods and support non ipc usage
Add trio.StrictFIFOLock on sender.send_all
Support max_bytes argument on receive_some, keep track of write_ptr on receiver
Add max_bytes receive test test_ringbuf_max_bytes
Add docstrings to all ringbuf tests
Remove EFD_NONBLOCK support, not necesary anymore since we can use abandon_on_cancel=True on trio.to_thread.run_sync
Close eventfd's after usage on open_ringbuf
2025-03-22 16:39:43 -03:00
Guillermo Rodriguez de45ad8829
Add buf_size to RBToken and add sender cancel test, move disable_mantracker to its own _mp_bs module 2025-03-22 16:39:01 -03:00
Guillermo Rodriguez 8adde29e39
Make ring buf api use pickle-able RBToken 2025-03-22 16:39:01 -03:00
Guillermo Rodriguez f552a3f8f5
Handle cancelation on EventFD.read 2025-03-22 16:39:01 -03:00
Guillermo Rodriguez a85c26017e
Move linux specifics from tractor.ipc._shm into tractor.ipc._linux 2025-03-22 16:39:00 -03:00
Guillermo Rodriguez ff1f4fa805
Move tractor._shm to tractor.ipc._shm 2025-03-22 16:39:00 -03:00
Guillermo Rodriguez 66c1d09ad4
General improvements
EventFD class now expects the fd to already be init with open_eventfd
RingBuff Sender and Receiver fully manage SharedMemory and EventFD lifecycles, no aditional ctx mngrs needed
Separate ring buf tests into its own test bed
Add parametrization to test and cancellation
Add docstrings
Add simple testing data gen module .samples
2025-03-22 16:39:00 -03:00