Sergey Sayamov

Results 11 comments of Sergey Sayamov

Very interesting discussion about sans-io approach! I'm more of an applied engineer and much less of an architect, so maybe not understand the problem from all sides. However, do I...

I have implemented a semi-efficient asynchronous filelock using anyio: https://github.com/dolamroth/starlette-web/blob/main/starlette_web/common/files/filelock.py It passes some basic tests: https://github.com/dolamroth/starlette-web/blob/main/starlette_web/tests/core/helpers/base_cache_tester.py If anyone is interested, you may pick it up.

I have the same error with: Windows 10, Python 3.9.2, anyio==4.2.0 Ubuntu 22, Python 3.10.12, anyio==4.2.0 P.S. For me that happened, when I had exception in my code, that processed...

I think, you may just use https://github.com/tiangolo/asyncer It is built with anyio, so it's trio-compatible https://asyncer.tiangolo.com/tutorial/soonify-return/

Test №1 process.py ```py import time import random while True: print(random.random(), flush=True) time.sleep(0.01) ``` test_subprocess.py ```py import sys from pathlib import Path import anyio from anyio.streams.buffered import BufferedByteReceiveStream async def...

Test №2 This has probably nothing to do directly with anyio, but I want to share this nonetheless. Let's simulate exception in user's code, by raising IndexError in `__anext__` test_subprocess.py...

I think, the second test is not linked to the `feed_eof` issue. Rather, it may be due to a bit contrintuitive behavior of `Process.aclose`. It turns out, that (in the...

Tests (I copypasted function name `limit_virtual_memory`, but it actually limits CPU instead, since it's easier to test) OS: CentOS Linux 8 Python 3.10.7 1.py ``` import sys sys.setrecursionlimit(1000) def fib(n):...

Test 2: switch back to limiting RAM ``` import anyio import subprocess import resource import sys MAX_VIRTUAL_MEMORY = 10 * 1024 * 1024 def limit_virtual_memory(): resource.setrlimit(resource.RLIMIT_AS, (MAX_VIRTUAL_MEMORY, MAX_VIRTUAL_MEMORY)) async def...

Test of trio ``` import trio import subprocess import resource import sys from functools import partial MAX_VIRTUAL_MEMORY = 10 * 1024 * 1024 def limit_virtual_memory(): resource.setrlimit(resource.RLIMIT_AS, (MAX_VIRTUAL_MEMORY, MAX_VIRTUAL_MEMORY)) async def...