File size: 1,094 Bytes
53dbcc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from typing import Union, Optional, Callable, Any

from .abstract import AbstractContext, AbstractOperation


# noinspection PyPropertyDefinition
class Context(AbstractContext):
    def __init__(self, max_requests: int = 32): ...


# noinspection PyPropertyDefinition
class Operation(AbstractOperation):
    @classmethod
    def read(
        cls, nbytes: int, fd: int, offset: int, priority=0
    ) -> "AbstractOperation": ...

    @classmethod
    def write(
        cls, payload_bytes: bytes,
        fd: int, offset: int, priority=0,
    ) -> "AbstractOperation": ...

    @classmethod
    def fsync(cls, fd: int, priority=0) -> "AbstractOperation": ...

    @classmethod
    def fdsync(cls, fd: int, priority=0) -> "AbstractOperation": ...

    def get_value(self) -> Union[bytes, int]: ...

    @property
    def fileno(self) -> int: ...

    @property
    def offset(self) -> int: ...

    @property
    def payload(self) -> Optional[Union[bytes, memoryview]]: ...

    @property
    def nbytes(self) -> int: ...

    def set_callback(self, callback: Callable[[int], Any]) -> bool: ...