moat-lib-stream 0.3.4__tar.gz → 0.3.5__tar.gz
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.
- {moat_lib_stream-0.3.4/src/moat_lib_stream.egg-info → moat_lib_stream-0.3.5}/PKG-INFO +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/debian/changelog +38 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/pyproject.toml +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/_cbor.py +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/_console.py +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/anyio.py +13 -11
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/base.py +6 -6
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/cbor.py +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/log.py +3 -3
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/reliable.py +13 -13
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/serial.py +1 -1
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/tcp.py +1 -1
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/terminal.py +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/unix.py +1 -1
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/ws.py +7 -7
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5/src/moat_lib_stream.egg-info}/PKG-INFO +2 -2
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat_lib_stream.egg-info/requires.txt +1 -1
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/LICENSE.txt +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/README.md +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/debian/.gitignore +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/debian/control +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/debian/rules +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/setup.cfg +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/__init__.py +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat/lib/stream/_layers.py +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat_lib_stream.egg-info/SOURCES.txt +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat_lib_stream.egg-info/dependency_links.txt +0 -0
- {moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat_lib_stream.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: moat-lib-stream
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: Stream infrastructure for MoaT applications
|
|
5
5
|
Maintainer-email: Matthias Urlichs <matthias@urlichs.de>
|
|
6
6
|
Project-URL: homepage, https://m-o-a-t.org
|
|
@@ -19,7 +19,7 @@ Requires-Dist: moat-lib-micro~=0.3.0
|
|
|
19
19
|
Requires-Dist: moat-lib-rpc~=0.7.0
|
|
20
20
|
Requires-Dist: moat-lib-codec~=0.4.14
|
|
21
21
|
Requires-Dist: moat-lib-repl~=0.1.4
|
|
22
|
-
Requires-Dist: moat-util~=0.
|
|
22
|
+
Requires-Dist: moat-util~=0.64.0
|
|
23
23
|
Dynamic: license-file
|
|
24
24
|
|
|
25
25
|
# Stream Infrastructure
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
moat-lib-stream (0.3.
|
|
1
|
+
moat-lib-stream (0.3.5-1) unstable; urgency=medium
|
|
2
|
+
|
|
3
|
+
* New release for 26.4.26
|
|
4
|
+
|
|
5
|
+
-- Matthias Urlichs <matthias@urlichs.de> Sat, 03 Oct 2026 12:54:00 +0200
|
|
6
|
+
|
|
7
|
+
moat-lib-stream (0.3.4-3) unstable; urgency=medium
|
|
8
|
+
|
|
9
|
+
* New release for 26.4.8
|
|
10
|
+
|
|
11
|
+
-- Matthias Urlichs <matthias@urlichs.de> Thu, 01 Oct 2026 11:15:56 +0200
|
|
12
|
+
|
|
13
|
+
moat-lib-stream (0.3.4-1) unstable; urgency=medium
|
|
2
14
|
|
|
3
15
|
* New release for 26.2.13
|
|
4
16
|
|
|
5
|
-
-- Matthias Urlichs <matthias@urlichs.de> Wed, 23 Sep 2026
|
|
17
|
+
-- Matthias Urlichs <matthias@urlichs.de> Wed, 23 Sep 2026 15:11:55 +0200
|
|
18
|
+
|
|
19
|
+
moat-lib-stream (0.3.3-2) unstable; urgency=medium
|
|
20
|
+
|
|
21
|
+
* New release for 26.2.9
|
|
22
|
+
|
|
23
|
+
-- Matthias Urlichs <matthias@urlichs.de> Sat, 11 Jul 2026 07:53:26 +0200
|
|
24
|
+
|
|
25
|
+
moat-lib-stream (0.3.3-1) unstable; urgency=medium
|
|
26
|
+
|
|
27
|
+
* New release for 26.2.8
|
|
28
|
+
|
|
29
|
+
-- Matthias Urlichs <matthias@urlichs.de> Sat, 11 Jul 2026 03:16:30 +0200
|
|
30
|
+
|
|
31
|
+
moat-lib-stream (0.3.2-3) unstable; urgency=medium
|
|
32
|
+
|
|
33
|
+
* New release for 26.2.3
|
|
34
|
+
|
|
35
|
+
-- Matthias Urlichs <matthias@urlichs.de> Mon, 15 Jun 2026 17:44:56 +0200
|
|
36
|
+
|
|
37
|
+
moat-lib-stream (0.3.2-2) unstable; urgency=medium
|
|
38
|
+
|
|
39
|
+
* New release for 26.1.12
|
|
40
|
+
|
|
41
|
+
-- Matthias Urlichs <matthias@urlichs.de> Fri, 24 Apr 2026 15:40:09 +0200
|
|
6
42
|
|
|
7
43
|
moat-lib-stream (0.3.2-1) unstable; urgency=medium
|
|
8
44
|
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
"moat-lib-rpc ~= 0.7.0",
|
|
17
17
|
"moat-lib-codec ~= 0.4.14",
|
|
18
18
|
"moat-lib-repl ~= 0.1.4",
|
|
19
|
-
"moat-util ~= 0.
|
|
19
|
+
"moat-util ~= 0.64.0",
|
|
20
20
|
]
|
|
21
21
|
keywords = ["MoaT"]
|
|
22
22
|
requires-python = ">=3.8"
|
|
@@ -24,7 +24,7 @@ name = "moat-lib-stream"
|
|
|
24
24
|
maintainers = [{email = "matthias@urlichs.de",name = "Matthias Urlichs"}]
|
|
25
25
|
description='Stream infrastructure for MoaT applications'
|
|
26
26
|
readme = "README.md"
|
|
27
|
-
version = "0.3.
|
|
27
|
+
version = "0.3.5"
|
|
28
28
|
|
|
29
29
|
[project.urls]
|
|
30
30
|
homepage = "https://m-o-a-t.org"
|
|
@@ -44,7 +44,7 @@ class _CBORMsgBuf(StackedMsg):
|
|
|
44
44
|
codec: Codec
|
|
45
45
|
liner: Liner | None = None
|
|
46
46
|
|
|
47
|
-
def __init__(self, stream: BaseBuf, cfg: dict):
|
|
47
|
+
def __init__(self, stream: BaseBuf, cfg: dict) -> None:
|
|
48
48
|
StackedMsg.__init__(self, stream, cfg)
|
|
49
49
|
self.w_lock = Lock()
|
|
50
50
|
|
|
@@ -57,7 +57,7 @@ class _CBORMsgBuf(StackedMsg):
|
|
|
57
57
|
if cons:
|
|
58
58
|
_CReader.__init__(cast(_CReader, self), cons)
|
|
59
59
|
|
|
60
|
-
async def setup(self):
|
|
60
|
+
async def setup(self) -> None:
|
|
61
61
|
await super().setup()
|
|
62
62
|
if self.cons is False:
|
|
63
63
|
from moat.util.liner import Liner # noqa:PLC0415
|
|
@@ -19,7 +19,7 @@ class _CReader:
|
|
|
19
19
|
A mix-in that processes incoming console data.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
def __init__(self, cons: bool | int):
|
|
22
|
+
def __init__(self, cons: bool | int) -> None:
|
|
23
23
|
if cons is True:
|
|
24
24
|
cons = 240 if sys.implementation.name == "micropython" else 32768
|
|
25
25
|
self.cevt = Event()
|
|
@@ -44,7 +44,7 @@ class _CReader:
|
|
|
44
44
|
self.cpos = 0
|
|
45
45
|
return n
|
|
46
46
|
|
|
47
|
-
def cput(self, b: int):
|
|
47
|
+
def cput(self, b: int) -> None:
|
|
48
48
|
"""store a byte in the console buffer"""
|
|
49
49
|
if self.cpos == len(self.cbuf):
|
|
50
50
|
if len(self.cbuf) > 100:
|
|
@@ -17,7 +17,7 @@ from moat.util import CtxObj
|
|
|
17
17
|
from moat.lib.micro import AC_use
|
|
18
18
|
from moat.lib.stream import BaseBuf
|
|
19
19
|
|
|
20
|
-
from typing import TYPE_CHECKING,
|
|
20
|
+
from typing import TYPE_CHECKING, cast
|
|
21
21
|
|
|
22
22
|
if TYPE_CHECKING:
|
|
23
23
|
from types import TracebackType
|
|
@@ -25,6 +25,8 @@ if TYPE_CHECKING:
|
|
|
25
25
|
from moat.lib.rpc import SubMsgSender
|
|
26
26
|
from moat.lib.stream.base import Buffer, MutBuffer
|
|
27
27
|
|
|
28
|
+
from typing import Any, Never
|
|
29
|
+
|
|
28
30
|
|
|
29
31
|
class ProcessDeadError(RuntimeError):
|
|
30
32
|
"""Process has died"""
|
|
@@ -76,7 +78,7 @@ class FilenoBuf(BaseBuf):
|
|
|
76
78
|
wfl: int
|
|
77
79
|
term: list[Any] | None
|
|
78
80
|
|
|
79
|
-
def __init__(self, cfg, fd: int, wfd: int | None = None):
|
|
81
|
+
def __init__(self, cfg, fd: int, wfd: int | None = None) -> None:
|
|
80
82
|
super().__init__(cfg)
|
|
81
83
|
self.rfd = fd
|
|
82
84
|
self.wfd = fd if wfd is None else wfd
|
|
@@ -86,7 +88,7 @@ class FilenoBuf(BaseBuf):
|
|
|
86
88
|
"Dummy here"
|
|
87
89
|
raise NotImplementedError("Dummy")
|
|
88
90
|
|
|
89
|
-
async def setup(self):
|
|
91
|
+
async def setup(self) -> None:
|
|
90
92
|
"Change to nonblocking and raw"
|
|
91
93
|
self.rfl = fcntl.fcntl(self.rfd, fcntl.F_SETFL, 0)
|
|
92
94
|
if self.rfd != self.wfd:
|
|
@@ -108,7 +110,7 @@ class FilenoBuf(BaseBuf):
|
|
|
108
110
|
cc[termios.VTIME] = 0
|
|
109
111
|
termios.tcsetattr(self.rfd, termios.TCSANOW, new)
|
|
110
112
|
|
|
111
|
-
async def teardown(self):
|
|
113
|
+
async def teardown(self) -> None:
|
|
112
114
|
"Return to blocking and cooked"
|
|
113
115
|
fcntl.fcntl(self.rfd, fcntl.F_SETFL, self.rfl)
|
|
114
116
|
if self.rfd != self.wfd:
|
|
@@ -144,7 +146,7 @@ class RemoteBufAnyio(ByteStream):
|
|
|
144
146
|
TODO: use remote iteration for receiving
|
|
145
147
|
"""
|
|
146
148
|
|
|
147
|
-
def __init__(self, disp: SubMsgSender):
|
|
149
|
+
def __init__(self, disp: SubMsgSender) -> None:
|
|
148
150
|
self.disp = disp
|
|
149
151
|
|
|
150
152
|
async def receive(self, max_bytes=256):
|
|
@@ -155,7 +157,7 @@ class RemoteBufAnyio(ByteStream):
|
|
|
155
157
|
"forward to ``.wr``"
|
|
156
158
|
await self.disp.wr(b=item)
|
|
157
159
|
|
|
158
|
-
async def aclose(self):
|
|
160
|
+
async def aclose(self) -> None:
|
|
159
161
|
"no-op"
|
|
160
162
|
|
|
161
163
|
async def send_eof(self):
|
|
@@ -170,7 +172,7 @@ class BufAnyio(ByteStream):
|
|
|
170
172
|
|
|
171
173
|
par = None
|
|
172
174
|
|
|
173
|
-
def __init__(self, stream: BaseBuf):
|
|
175
|
+
def __init__(self, stream: BaseBuf) -> None:
|
|
174
176
|
self.stream = stream
|
|
175
177
|
|
|
176
178
|
async def __aenter__(self):
|
|
@@ -209,7 +211,7 @@ class SingleAnyioBuf(AnyioBuf):
|
|
|
209
211
|
once.
|
|
210
212
|
"""
|
|
211
213
|
|
|
212
|
-
def __init__(self, stream):
|
|
214
|
+
def __init__(self, stream) -> None:
|
|
213
215
|
self._s = stream
|
|
214
216
|
|
|
215
217
|
async def stream(self): # noqa:D102
|
|
@@ -235,7 +237,7 @@ class ProcessBuf(CtxObj, AnyioBuf):
|
|
|
235
237
|
argv: list[str] | None = None
|
|
236
238
|
env: dict[str, str] | None = None
|
|
237
239
|
|
|
238
|
-
def __init__(self, cfg, executable: str | None = None, **kw):
|
|
240
|
+
def __init__(self, cfg, executable: str | None = None, **kw) -> None:
|
|
239
241
|
super().__init__(cfg)
|
|
240
242
|
kw.setdefault("stderr", sys.stderr)
|
|
241
243
|
self.kw: dict[str, Any] = dict(kw)
|
|
@@ -299,8 +301,8 @@ class ProcessBuf(CtxObj, AnyioBuf):
|
|
|
299
301
|
if proc is not None and proc.returncode != 0 and proc.returncode != -9:
|
|
300
302
|
raise ProcessDeadError(f"{self} died with {proc.returncode}")
|
|
301
303
|
|
|
302
|
-
async def setup(self): # noqa:D102
|
|
304
|
+
async def setup(self) -> None: # noqa:D102
|
|
303
305
|
pass
|
|
304
306
|
|
|
305
|
-
async def stream(self): # noqa:D102
|
|
307
|
+
async def stream(self) -> Never: # noqa:D102
|
|
306
308
|
raise RuntimeError("should not be called")
|
|
@@ -90,7 +90,7 @@ class Base(_AACMBase):
|
|
|
90
90
|
s = None
|
|
91
91
|
cfg: attrdict
|
|
92
92
|
|
|
93
|
-
def __init__(self, cfg: attrdict | None = None):
|
|
93
|
+
def __init__(self, cfg: attrdict | None = None) -> None:
|
|
94
94
|
if cfg is None:
|
|
95
95
|
cfg = attrdict()
|
|
96
96
|
self.cfg = cfg
|
|
@@ -132,14 +132,14 @@ class Base(_AACMBase):
|
|
|
132
132
|
) -> bool | None:
|
|
133
133
|
return await AC_exit(self, exc_type, exc, tb)
|
|
134
134
|
|
|
135
|
-
async def setup(self):
|
|
135
|
+
async def setup(self) -> None:
|
|
136
136
|
"""
|
|
137
137
|
Basic async setup method. You may use AC_exit.
|
|
138
138
|
|
|
139
139
|
Call the superclass first, when overriding.
|
|
140
140
|
"""
|
|
141
141
|
|
|
142
|
-
async def teardown(self):
|
|
142
|
+
async def teardown(self) -> None:
|
|
143
143
|
"""
|
|
144
144
|
Object destructor.
|
|
145
145
|
|
|
@@ -164,7 +164,7 @@ class BaseConn(Base):
|
|
|
164
164
|
|
|
165
165
|
s: Any = None
|
|
166
166
|
|
|
167
|
-
async def setup(self):
|
|
167
|
+
async def setup(self) -> None:
|
|
168
168
|
"""
|
|
169
169
|
Object construction.
|
|
170
170
|
|
|
@@ -176,7 +176,7 @@ class BaseConn(Base):
|
|
|
176
176
|
|
|
177
177
|
self.s = await self.stream()
|
|
178
178
|
|
|
179
|
-
async def teardown(self):
|
|
179
|
+
async def teardown(self) -> None:
|
|
180
180
|
"""
|
|
181
181
|
Object destructor.
|
|
182
182
|
|
|
@@ -273,7 +273,7 @@ class StackedConn(BaseConn):
|
|
|
273
273
|
|
|
274
274
|
link: BaseConn | None = None
|
|
275
275
|
|
|
276
|
-
def __init__(self, link: BaseConn, cfg):
|
|
276
|
+
def __init__(self, link: BaseConn, cfg) -> None:
|
|
277
277
|
super().__init__(cfg=cfg)
|
|
278
278
|
self.link = link
|
|
279
279
|
|
|
@@ -17,7 +17,7 @@ class CBORMsgBuf(_CBORMsgBuf):
|
|
|
17
17
|
message boundaries.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
async def setup(self): # noqa:D102
|
|
20
|
+
async def setup(self) -> None: # noqa:D102
|
|
21
21
|
await super().setup()
|
|
22
22
|
self.codec = get_codec(self.cfg.get("codec", "std-cbor"))
|
|
23
23
|
|
|
@@ -30,6 +30,6 @@ class CBORMsgBlk(_CBORMsgBlk):
|
|
|
30
30
|
(one bytestring-ized message per call).
|
|
31
31
|
"""
|
|
32
32
|
|
|
33
|
-
async def setup(self): # noqa:D102
|
|
33
|
+
async def setup(self) -> None: # noqa:D102
|
|
34
34
|
await super().setup()
|
|
35
35
|
self.codec = get_codec(self.cfg.get("codec", "std-cbor"))
|
|
@@ -25,18 +25,18 @@ class LogMsg(StackedMsg, StackedBuf, StackedBlk):
|
|
|
25
25
|
# StackedMsg is first because MicroPython uses only the first class and
|
|
26
26
|
# we get `cwr` and `crd` that way.
|
|
27
27
|
|
|
28
|
-
def __init__(self, link, cfg):
|
|
28
|
+
def __init__(self, link, cfg) -> None:
|
|
29
29
|
super().__init__(link, cfg)
|
|
30
30
|
self.txt = cfg.get("txt", "S")
|
|
31
31
|
self.decode = self.txt[0] == "!"
|
|
32
32
|
if self.decode:
|
|
33
33
|
self.txt = self.txt[1:]
|
|
34
34
|
|
|
35
|
-
async def setup(self): # noqa:D102
|
|
35
|
+
async def setup(self) -> None: # noqa:D102
|
|
36
36
|
log("X:%s start", self.txt)
|
|
37
37
|
await super().setup()
|
|
38
38
|
|
|
39
|
-
async def teardown(self): # noqa:D102
|
|
39
|
+
async def teardown(self) -> None: # noqa:D102
|
|
40
40
|
log("X:%s stop", self.txt)
|
|
41
41
|
await super().teardown()
|
|
42
42
|
|
|
@@ -39,7 +39,7 @@ class EphemeralMsg:
|
|
|
39
39
|
updated.
|
|
40
40
|
"""
|
|
41
41
|
|
|
42
|
-
def __init__(self, chan: int, data: Any):
|
|
42
|
+
def __init__(self, chan: int, data: Any) -> None:
|
|
43
43
|
self.chan = chan
|
|
44
44
|
self.data = data
|
|
45
45
|
|
|
@@ -108,7 +108,7 @@ class ReliableMsg(StackedMsg):
|
|
|
108
108
|
_tg = None
|
|
109
109
|
__tg = None
|
|
110
110
|
|
|
111
|
-
def __init__(self, link, cfg):
|
|
111
|
+
def __init__(self, link, cfg) -> None:
|
|
112
112
|
super().__init__(link, cfg)
|
|
113
113
|
|
|
114
114
|
window = cfg.get("window", 8)
|
|
@@ -128,7 +128,7 @@ class ReliableMsg(StackedMsg):
|
|
|
128
128
|
self.retries = retries
|
|
129
129
|
self._iters = {}
|
|
130
130
|
|
|
131
|
-
def reset(self, level=1): # noqa:D102
|
|
131
|
+
def reset(self, level=1) -> None: # noqa:D102
|
|
132
132
|
self.s_send_head = 0 # next to be transmitted
|
|
133
133
|
self.s_send_tail = 0 # no open messages before this point
|
|
134
134
|
self.s_recv_head = 0 # next expected message. Messages before this are out of sequence
|
|
@@ -145,7 +145,7 @@ class ReliableMsg(StackedMsg):
|
|
|
145
145
|
if self.rq is None:
|
|
146
146
|
self.rq = Queue(self.window)
|
|
147
147
|
|
|
148
|
-
async def send_msg(self, k=None):
|
|
148
|
+
async def send_msg(self, k=None) -> None:
|
|
149
149
|
"""
|
|
150
150
|
Send some message.
|
|
151
151
|
|
|
@@ -194,7 +194,7 @@ class ReliableMsg(StackedMsg):
|
|
|
194
194
|
if k is not None and self.m_send.get(k, None) is mte:
|
|
195
195
|
mte[1] = ticks_add(ticks_ms(), self.timeout)
|
|
196
196
|
|
|
197
|
-
async def _run_bg(self):
|
|
197
|
+
async def _run_bg(self) -> None:
|
|
198
198
|
while not self.closed:
|
|
199
199
|
if self.in_reset:
|
|
200
200
|
await self._trigger.wait()
|
|
@@ -270,7 +270,7 @@ class ReliableMsg(StackedMsg):
|
|
|
270
270
|
if nk is None:
|
|
271
271
|
self.t_recv = ticks_add(ticks_ms(), self.timeout)
|
|
272
272
|
|
|
273
|
-
async def wait(self):
|
|
273
|
+
async def wait(self) -> None:
|
|
274
274
|
"""
|
|
275
275
|
Wait until the lower side is (again) ready to be used.
|
|
276
276
|
|
|
@@ -307,12 +307,12 @@ class ReliableMsg(StackedMsg):
|
|
|
307
307
|
self._tg = None
|
|
308
308
|
return await AC_exit(self, exc_type, exc, tb)
|
|
309
309
|
|
|
310
|
-
async def _mon(self):
|
|
310
|
+
async def _mon(self) -> None:
|
|
311
311
|
while True:
|
|
312
312
|
await wait_for_ms(self.retries * self.timeout, self._is_up.wait)
|
|
313
313
|
await self._is_down.wait()
|
|
314
314
|
|
|
315
|
-
async def _run_(self):
|
|
315
|
+
async def _run_(self) -> None:
|
|
316
316
|
if self._is_down.is_set():
|
|
317
317
|
self._is_down = Event()
|
|
318
318
|
self.reset_level = 1
|
|
@@ -355,7 +355,7 @@ class ReliableMsg(StackedMsg):
|
|
|
355
355
|
self._is_up = Event()
|
|
356
356
|
self._trigger.set()
|
|
357
357
|
|
|
358
|
-
async def _run(self):
|
|
358
|
+
async def _run(self) -> None:
|
|
359
359
|
self.reset()
|
|
360
360
|
try:
|
|
361
361
|
while True:
|
|
@@ -395,7 +395,7 @@ class ReliableMsg(StackedMsg):
|
|
|
395
395
|
except EOFError:
|
|
396
396
|
pass
|
|
397
397
|
|
|
398
|
-
async def send_reset(self, level=None, err=None):
|
|
398
|
+
async def send_reset(self, level=None, err=None) -> None:
|
|
399
399
|
"send a Reset message to the other side"
|
|
400
400
|
if level is None:
|
|
401
401
|
level = self.reset_level
|
|
@@ -450,13 +450,13 @@ class ReliableMsg(StackedMsg):
|
|
|
450
450
|
def _get_config(self):
|
|
451
451
|
return [self.window, self.timeout]
|
|
452
452
|
|
|
453
|
-
def _update_config(self, c):
|
|
453
|
+
def _update_config(self, c) -> None:
|
|
454
454
|
if len(c) > 0 and c[0] > 0:
|
|
455
455
|
self.window = max(4, min(self.window, c[0]))
|
|
456
456
|
if len(c) > 1 and c[1] > 0:
|
|
457
457
|
self.timeout = max(10, self.timeout, c[1])
|
|
458
458
|
|
|
459
|
-
def _reset_done(self):
|
|
459
|
+
def _reset_done(self) -> None:
|
|
460
460
|
if self.in_reset:
|
|
461
461
|
self.in_reset = False
|
|
462
462
|
self._trigger.set()
|
|
@@ -485,7 +485,7 @@ class ReliableMsg(StackedMsg):
|
|
|
485
485
|
"check if the link is down"
|
|
486
486
|
return self._is_down.is_set()
|
|
487
487
|
|
|
488
|
-
async def _dispatch(self, msg):
|
|
488
|
+
async def _dispatch(self, msg) -> None:
|
|
489
489
|
if not isinstance(msg, (tuple, list)):
|
|
490
490
|
raise TypeError(msg)
|
|
491
491
|
|
|
@@ -27,7 +27,7 @@ class SerialPackerBlkBuf(StackedBlk):
|
|
|
27
27
|
|
|
28
28
|
cons = False
|
|
29
29
|
|
|
30
|
-
def __init__(self, stream: BaseBuf, frame: dict, console: bool | int = False):
|
|
30
|
+
def __init__(self, stream: BaseBuf, frame: dict, console: bool | int = False) -> None:
|
|
31
31
|
StackedBlk.__init__(self, stream, None)
|
|
32
32
|
|
|
33
33
|
SerialPacker = __import__("serialpacker", globals(), None, ("SerialPacker",)).SerialPacker
|
|
@@ -17,7 +17,7 @@ class TcpLink(AnyioBuf):
|
|
|
17
17
|
A channel that connects to a remote TCP socket.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
def __init__(self, host: str, port: int, retry: dict = {}): # noqa:B006
|
|
20
|
+
def __init__(self, host: str, port: int, retry: dict = {}) -> None: # noqa:B006
|
|
21
21
|
self.host = host
|
|
22
22
|
self.port = port
|
|
23
23
|
self.retry = retry
|
|
@@ -89,7 +89,7 @@ class FilenoTerm(FilenoBuf, TermBuf):
|
|
|
89
89
|
Warning: Setting up raw mode etc. is the responsibility of the caller.
|
|
90
90
|
"""
|
|
91
91
|
|
|
92
|
-
async def setup(self): # noqa:D102
|
|
92
|
+
async def setup(self) -> None: # noqa:D102
|
|
93
93
|
await super().setup()
|
|
94
94
|
|
|
95
95
|
self.__orig_termstate = await self.tget()
|
|
@@ -135,7 +135,7 @@ class FilenoTerm(FilenoBuf, TermBuf):
|
|
|
135
135
|
else:
|
|
136
136
|
return True
|
|
137
137
|
|
|
138
|
-
async def forget_input(self):
|
|
138
|
+
async def forget_input(self) -> None:
|
|
139
139
|
"Delete pending input"
|
|
140
140
|
termios.tcflush(self.rfd, termios.TCIFLUSH)
|
|
141
141
|
|
|
@@ -23,7 +23,7 @@ class UnixLink(AnyioBuf):
|
|
|
23
23
|
A channel that connects to a remote Unix socket.
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
def __init__(self, port: str | PathLike[str], retry: dict | None = None):
|
|
26
|
+
def __init__(self, port: str | PathLike[str], retry: dict | None = None) -> None:
|
|
27
27
|
self.port = port
|
|
28
28
|
if retry is None:
|
|
29
29
|
retry = {}
|
|
@@ -59,7 +59,7 @@ class WsLink(BaseBlk):
|
|
|
59
59
|
*,
|
|
60
60
|
subprotocols: list[str] | None = None,
|
|
61
61
|
**kw,
|
|
62
|
-
):
|
|
62
|
+
) -> None:
|
|
63
63
|
self.url = url
|
|
64
64
|
if retry is None:
|
|
65
65
|
retry = {}
|
|
@@ -112,7 +112,7 @@ class WsLink(BaseBlk):
|
|
|
112
112
|
log("Fail: %s, %r", self.url, er)
|
|
113
113
|
raise
|
|
114
114
|
|
|
115
|
-
async def setup(self): # noqa:D102
|
|
115
|
+
async def setup(self) -> None: # noqa:D102
|
|
116
116
|
await super().setup()
|
|
117
117
|
|
|
118
118
|
self._crd_buf = bytearray()
|
|
@@ -129,7 +129,7 @@ class WsLink(BaseBlk):
|
|
|
129
129
|
await AC_use(self, self._tg.cancel_scope.cancel)
|
|
130
130
|
self._tg.start_soon(self._reader)
|
|
131
131
|
|
|
132
|
-
async def _reader(self):
|
|
132
|
+
async def _reader(self) -> None:
|
|
133
133
|
from httpx_ws import WebSocketDisconnect, WebSocketNetworkError # noqa:PLC0415
|
|
134
134
|
|
|
135
135
|
ws = cast("AsyncWebSocketSession", self.s)
|
|
@@ -228,7 +228,7 @@ class SingleWsBlk(BaseBlk):
|
|
|
228
228
|
path: str | None = None,
|
|
229
229
|
*,
|
|
230
230
|
subprotocols: list[str] | None = None,
|
|
231
|
-
):
|
|
231
|
+
) -> None:
|
|
232
232
|
self._stream = stream
|
|
233
233
|
self.path = path
|
|
234
234
|
self.subprotocols = subprotocols
|
|
@@ -237,7 +237,7 @@ class SingleWsBlk(BaseBlk):
|
|
|
237
237
|
async def stream(self): # noqa:D102
|
|
238
238
|
return await AC_use(self, self._stream)
|
|
239
239
|
|
|
240
|
-
async def setup(self): # noqa:D102
|
|
240
|
+
async def setup(self) -> None: # noqa:D102
|
|
241
241
|
await super().setup()
|
|
242
242
|
self._ws = wsproto.WSConnection(ConnectionType.SERVER)
|
|
243
243
|
self._crd_buf = bytearray()
|
|
@@ -300,7 +300,7 @@ class SingleWsBlk(BaseBlk):
|
|
|
300
300
|
if closed:
|
|
301
301
|
raise EOFError
|
|
302
302
|
|
|
303
|
-
async def _reader(self):
|
|
303
|
+
async def _reader(self) -> None:
|
|
304
304
|
ws = self._ws
|
|
305
305
|
if ws is None:
|
|
306
306
|
return
|
|
@@ -377,7 +377,7 @@ class SingleWsBlk(BaseBlk):
|
|
|
377
377
|
self._crd_buf = self._crd_buf[n:]
|
|
378
378
|
return n
|
|
379
379
|
|
|
380
|
-
async def teardown(self): # noqa:D102
|
|
380
|
+
async def teardown(self) -> None: # noqa:D102
|
|
381
381
|
if self._ws is not None:
|
|
382
382
|
with suppress(Exception):
|
|
383
383
|
await self._send_raw(self._ws.send(CloseConnection(code=1000, reason="bye")))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: moat-lib-stream
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: Stream infrastructure for MoaT applications
|
|
5
5
|
Maintainer-email: Matthias Urlichs <matthias@urlichs.de>
|
|
6
6
|
Project-URL: homepage, https://m-o-a-t.org
|
|
@@ -19,7 +19,7 @@ Requires-Dist: moat-lib-micro~=0.3.0
|
|
|
19
19
|
Requires-Dist: moat-lib-rpc~=0.7.0
|
|
20
20
|
Requires-Dist: moat-lib-codec~=0.4.14
|
|
21
21
|
Requires-Dist: moat-lib-repl~=0.1.4
|
|
22
|
-
Requires-Dist: moat-util~=0.
|
|
22
|
+
Requires-Dist: moat-util~=0.64.0
|
|
23
23
|
Dynamic: license-file
|
|
24
24
|
|
|
25
25
|
# Stream Infrastructure
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{moat_lib_stream-0.3.4 → moat_lib_stream-0.3.5}/src/moat_lib_stream.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|