Skip to content

Commit 79988b8

Browse files
committed
Drop 3.8, add backpressure, update old Queue usage
1 parent c967381 commit 79988b8

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
15+
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
1616
platform: ["windows", "ubuntu", "macos"]
1717

1818
steps:

noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def test_oldest(session):
3131
"3.12": "trio>=0.23.0",
3232
"3.11": "trio>=0.21.0",
3333
"3.10": "trio>=0.20.0",
34-
"3.9": "trio>=0.19.0",
35-
"3.8": "trio",
34+
"3.9": "trio",
3635
}
3736

3837
session.install(".", possible_trio[pyver], "--resolution=lowest-direct")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ name = "trio-monitor"
99
description = "A monitor utility for Trio"
1010
readme = "README.rst"
1111
license = "MIT OR Apache-2.0"
12-
dependencies = ["trio>=0.15.0"]
13-
requires-python = ">=3.8"
12+
dependencies = ["trio>=0.19.0"]
13+
requires-python = ">=3.9"
1414
authors = [
1515
{ name = "Lura Skye", email = "[email protected]" }
1616
]

src/trio_monitor/monitor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self):
5454
self._is_monitoring = False
5555
# semi-arbitrary size, because otherwise we'll be dropping events
5656
# no clue how to make this better, alas.
57-
self._rx, self._tx = open_memory_channel(math.inf)
57+
self._rx, self._tx = open_memory_channel(100)
5858

5959
@staticmethod
6060
def get_root_task() -> Task:
@@ -121,7 +121,7 @@ def _add_to_monitoring_queue(self, item):
121121
return
122122

123123
try:
124-
self._monitoring_queue.put_nowait(item)
124+
self._tx.send_nowait(item)
125125
except WouldBlock:
126126
return
127127

@@ -191,7 +191,8 @@ async def main_loop(self, stream):
191191
async def do_monitor(self, stream):
192192
"""Livefeeds information about the running program."""
193193
prefix = "[FEED] "
194-
async for item in self._monitoring_queue:
194+
while True:
195+
item = await self._rx.receive()
195196
key = item[0]
196197

197198
if key == "task_spawned":

0 commit comments

Comments
 (0)