Commit Graph

12 Commits (1bade68c79340d61a08c71cb30416c018d6afa5d)

Author SHA1 Message Date
Guillermo Rodriguez 1bade68c79
Catch trio cancellation on RingBuffReceiver bg eof listener task, add batched mode to RingBuffBytesSender 2025-03-27 19:14:21 -03:00
Guillermo Rodriguez 5b51bb47a4
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-27 19:14:21 -03:00
Guillermo Rodriguez 7d4e745e25
Add direct ctx managers for RB channels 2025-03-27 19:14:21 -03:00
Guillermo Rodriguez 9ee585e599
Improve test_ringbuf test, drop MsgTransport ring buf impl for now in favour of a trio.abc.Channel[bytes] impl, add docstrings 2025-03-27 19:14:21 -03:00
Guillermo Rodriguez e56306e8f0
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-27 19:14:21 -03:00
Guillermo Rodriguez c424f6c8d5
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-27 19:14:21 -03:00
Guillermo Rodriguez 0bd78a0a12
Add buf_size to RBToken and add sender cancel test, move disable_mantracker to its own _mp_bs module 2025-03-27 19:14:21 -03:00
Guillermo Rodriguez c18d2548f6
Make ring buf api use pickle-able RBToken 2025-03-27 19:14:21 -03:00
Guillermo Rodriguez 4a47b4a1e3
Address some of fomo\'s comments 2025-03-27 19:14:20 -03:00
Guillermo Rodriguez fc7a8a5441
Handle cancelation on EventFD.read 2025-03-27 19:14:20 -03:00
Guillermo Rodriguez 22a84bcb74
Add module headers and fix spacing on tractor._ipc._linux 2025-03-27 19:14:20 -03:00
Guillermo Rodriguez bae342a7bc
Move RingBuffSender|Receiver to its own tractor.ipc._ringbuf module 2025-03-27 19:14:20 -03:00