• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mosquito / caio / 22801592649

07 Mar 2026 03:17PM UTC coverage: 88.858% (+0.7%) from 88.182%
22801592649

push

github

web-flow
Merge pull request #55 from mosquito/feature/iouring

Added uring

30 of 31 new or added lines in 4 files covered. (96.77%)

319 of 359 relevant lines covered (88.86%)

10.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.24
/caio/linux_uring_asyncio.py
1
from .asyncio_base import AsyncioContextBase
14✔
2
from .linux_uring import Context, Operation
14✔
3

4

5
class AsyncioContext(AsyncioContextBase):
5✔
6
    OPERATION_CLASS = Operation
5✔
7
    CONTEXT_CLASS = Context
5✔
8

9
    def _create_context(self, max_requests):
5✔
10
        context = super()._create_context(max_requests)
5✔
11
        self.loop.add_reader(context.fileno, self._on_read_event)
5✔
12
        return context
5✔
13

14
    def _on_done(self, future, result):
5✔
15
        if future.done():
5✔
NEW
16
            return
×
17
        future.set_result(True)
5✔
18

19
    def _destroy_context(self):
5✔
20
        self.loop.remove_reader(self.context.fileno)
5✔
21

22
    def _on_submitted(self):
5✔
23
        # Flush immediately after every submit.
24
        #
25
        # Non-SQPOLL (default): flush() calls io_uring_enter() which completes
26
        # page-cache ops inline, then drain_cq() fires futures *before* the
27
        # caller reaches `await future` — so the coroutine never suspends for
28
        # those ops.  Truly async ops (real disk) leave the future unset; the
29
        # coroutine suspends and the eventfd wakes it when the kernel is done.
30
        #
31
        # SQPOLL: flush() wakes the kernel thread if sleeping, then drain_cq().
32
        # Same "fast path" benefit when the thread has already completed the op.
33
        self.context.flush()
5✔
34

35
    def _on_read_event(self):
5✔
36
        """Handle completions signalled via the eventfd."""
37
        self.context.poll()
5✔
38
        while self.context.process_events():
5✔
39
            pass
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc