# Latest

**URL:** https://trio.discourse.group/latest.md

[Latest](https://trio.discourse.group/latest.md) · [Categories](https://trio.discourse.group/categories.md)

---

## [Welcome to the Trio forum!](https://trio.discourse.group/t/welcome-to-the-trio-forum/7)

<div class="topic-metadata">

**Author:** [@system](https://trio.discourse.group/u/system)\
**Replies:** 0\
**Last updated:** [February 4, 2019, 10:46am UTC](https://trio.discourse.group/t/welcome-to-the-trio-forum/7 "2019-02-04T10:46:09Z")

</div>

This is the official forum for Trio, a friendly async concurrency library for Python. You can: Ask questions about how to use Trio, or about how it compares to other libraries. Announce new libraries, advertise blog po…

---

## [Discussion: "Notes on structured concurrency, or: Go statement considered harmful"](https://trio.discourse.group/t/discussion-notes-on-structured-concurrency-or-go-statement-considered-harmful/25)

<div class="topic-metadata">

**Author:** [@njs](https://trio.discourse.group/u/njs)\
**Replies:** 27\
**Last updated:** [March 21, 2026, 12:15pm UTC](https://trio.discourse.group/t/discussion-notes-on-structured-concurrency-or-go-statement-considered-harmful/25 "2026-03-21T12:15:35Z")

</div>

You can use this thread to discuss the blog post Notes on structured concurrency, or: Go statement considered harmful.

---

## [Do finished tasks take up resources?](https://trio.discourse.group/t/do-finished-tasks-take-up-resources/6584)

<div class="topic-metadata">

**Author:** [@Nikratio](https://trio.discourse.group/u/Nikratio)\
**Replies:** 1\
**Last updated:** [March 15, 2026, 10:08am UTC](https://trio.discourse.group/t/do-finished-tasks-take-up-resources/6584 "2026-03-15T10:08:00Z")

</div>

Hello, Do finished tasks take up resources? In other words, will the following code consume unbounded memory, or are the tasks fully cleaned up once they exit cleanly? async def do\_work(): await trio.sleep(1) async…

---

## [\`Runtime Error\` occuring when running tests on trio-asyncio](https://trio.discourse.group/t/runtime-error-occuring-when-running-tests-on-trio-asyncio/570)

<div class="topic-metadata">

**Author:** [@Aman\_Rao](https://trio.discourse.group/u/Aman_Rao)\
**Replies:** 0\
**Last updated:** [October 27, 2025, 6:17pm UTC](https://trio.discourse.group/t/runtime-error-occuring-when-running-tests-on-trio-asyncio/570 "2025-10-27T18:17:36Z")

</div>

Getting the following error on running tests on asyncio: ImportError while loading conftest '/home/amanr/Documents/trio-asyncio/tests/conftest.py'. tests/conftest.py:30: in \<module\> warnings.warn( E RuntimeWarning…

---

## [Atmos - Structured Event-Driven Concurrency for Lua](https://trio.discourse.group/t/atmos-structured-event-driven-concurrency-for-lua/568)

<div class="topic-metadata">

**Author:** [@fsantanna](https://trio.discourse.group/u/fsantanna)\
**Replies:** 0\
**Last updated:** [July 25, 2025, 11:46am UTC](https://trio.discourse.group/t/atmos-structured-event-driven-concurrency-for-lua/568 "2025-07-25T11:46:53Z")

</div>

Hello, Atmos is a programming library for Lua that reconciles Structured Concurrency with Event-Driven Programming: All feedback is welcome. Francisco

---

## [The Watermelon Operator](https://trio.discourse.group/t/the-watermelon-operator/532)

<div class="topic-metadata">

**Author:** [@matklad](https://trio.discourse.group/u/matklad)\
**Replies:** 2\
**Last updated:** [July 15, 2025, 3:13pm UTC](https://trio.discourse.group/t/the-watermelon-operator/532 "2025-07-15T15:13:04Z")

</div>

---

## [Coding custom \`Channel\`s](https://trio.discourse.group/t/coding-custom-channel-s/565)

<div class="topic-metadata">

**Author:** [@astrogewgaw](https://trio.discourse.group/u/astrogewgaw)\
**Replies:** 0\
**Last updated:** [June 8, 2025, 6:46am UTC](https://trio.discourse.group/t/coding-custom-channel-s/565 "2025-06-08T06:46:36Z")

</div>

Hi all! I am trying to program a pipeline that takes data in chunks from a shared-memory-based ring buffer, and processes each chunk. After quite a bit of thought, I decided that programming this asynchronously is the wa…

---

## [Discussion: "Beautiful tracebacks in Trio v0.7.0"](https://trio.discourse.group/t/discussion-beautiful-tracebacks-in-trio-v0-7-0/29)

<div class="topic-metadata">

**Author:** [@njs](https://trio.discourse.group/u/njs)\
**Replies:** 4\
**Last updated:** [May 14, 2025, 3:23am UTC](https://trio.discourse.group/t/discussion-beautiful-tracebacks-in-trio-v0-7-0/29 "2025-05-14T03:23:49Z")

</div>

You can use this thread to discuss the blog post Beautiful tracebacks in Trio v0.7.0.

---

## [Discussion: "Some thoughts on asynchronous API design in a post-async/await world"](https://trio.discourse.group/t/discussion-some-thoughts-on-asynchronous-api-design-in-a-post-async-await-world/32)

<div class="topic-metadata">

**Author:** [@njs](https://trio.discourse.group/u/njs)\
**Replies:** 4\
**Last updated:** [March 20, 2025, 7:13pm UTC](https://trio.discourse.group/t/discussion-some-thoughts-on-asynchronous-api-design-in-a-post-async-await-world/32 "2025-03-20T19:13:57Z")

</div>

You can use this thread to discuss the blog post Some thoughts on asynchronous API design in a post-async/await world. It’s long and a bit out-of-date at this point, but this is ultimately where Trio started!

---

## [Advice to implementing state machine](https://trio.discourse.group/t/advice-to-implementing-state-machine/540)

<div class="topic-metadata">

**Author:** [@zoranbosnjak](https://trio.discourse.group/u/zoranbosnjak)\
**Replies:** 3\
**Last updated:** [February 8, 2025, 11:28pm UTC](https://trio.discourse.group/t/advice-to-implementing-state-machine/540 "2025-02-08T23:28:23Z")

</div>

Dear trio comunity, what is the suggested way to implement a simple state machine with trio? The intention is to avoid global state variable and additional state transition loop, something like this: import trio asyn…

---

## [When are 'callbacks' acceptable?](https://trio.discourse.group/t/when-are-callbacks-acceptable/330)

<div class="topic-metadata">

**Author:** [@takluyver](https://trio.discourse.group/u/takluyver)\
**Replies:** 5\
**Last updated:** [October 30, 2024, 3:29pm UTC](https://trio.discourse.group/t/when-are-callbacks-acceptable/330 "2024-10-30T15:29:55Z")

</div>

From reading Nathaniel’s blog posts, I understand that avoiding callbacks is a central concept of structured concurrency. The Trio design docs back this up: Task spawning is always explicit. No callbacks, no implicit c…

---

## [Schrödinger's colored function? How to \`eval\` the output of \`compile\` with the \`PyCF\_ALLOW\_TOP\_LEVEL\_AWAIT\` flag](https://trio.discourse.group/t/schrodingers-colored-function-how-to-eval-the-output-of-compile-with-the-pycf-allow-top-level-await-flag/531)

<div class="topic-metadata">

**Author:** [@bradleyharden](https://trio.discourse.group/u/bradleyharden)\
**Replies:** 1\
**Last updated:** [September 7, 2024, 4:37pm UTC](https://trio.discourse.group/t/schrodingers-colored-function-how-to-eval-the-output-of-compile-with-the-pycf-allow-top-level-await-flag/531 "2024-09-07T16:37:23Z")

</div>

I’ve run into an interesting problem, but before I get to it, I think it would make sense to review my entire architecture, in case there is a fundamentally better approach that still satisfies all my design requirements…

---

## [Non-blocking logging in trio](https://trio.discourse.group/t/non-blocking-logging-in-trio/529)

<div class="topic-metadata">

**Author:** [@sasa-buklijas](https://trio.discourse.group/u/sasa-buklijas)\
**Replies:** 0\
**Last updated:** [August 29, 2024, 6:12pm UTC](https://trio.discourse.group/t/non-blocking-logging-in-trio/529 "2024-08-29T18:12:30Z")

</div>

Is there some trio library for logging ? I am familiar with python import logging, but my concern is that ever call to is is blocking. So would like to use something that is non-blocking and is supported by trio. Any …

---

## [Discussion: "Timeouts and cancellation for humans"](https://trio.discourse.group/t/discussion-timeouts-and-cancellation-for-humans/26)

<div class="topic-metadata">

**Author:** [@njs](https://trio.discourse.group/u/njs)\
**Replies:** 7\
**Last updated:** [July 11, 2024, 9:49am UTC](https://trio.discourse.group/t/discussion-timeouts-and-cancellation-for-humans/26 "2024-07-11T09:49:23Z")

</div>

You can use this thread to discuss the blog post Timeouts and cancellation for humans.

---

## [Arbitrary number of "asynchronous context managers"](https://trio.discourse.group/t/arbitrary-number-of-asynchronous-context-managers/519)

<div class="topic-metadata">

**Author:** [@jetson](https://trio.discourse.group/u/jetson)\
**Replies:** 3\
**Last updated:** [June 21, 2024, 6:12pm UTC](https://trio.discourse.group/t/arbitrary-number-of-asynchronous-context-managers/519 "2024-06-21T18:12:33Z")

</div>

Hello, I am having trouble getting async with to work with an arbitrary (and varying) number of asynchronous context managers. Once, contextlib provided nested for this, but apparently they were unable to make it work p…

---

## [A Slot class for passing a result to a different coroutine](https://trio.discourse.group/t/a-slot-class-for-passing-a-result-to-a-different-coroutine/515)

<div class="topic-metadata">

**Author:** [@merlinz01](https://trio.discourse.group/u/merlinz01)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 6:54pm UTC](https://trio.discourse.group/t/a-slot-class-for-passing-a-result-to-a-different-coroutine/515 "2024-05-21T18:54:28Z")

</div>

I just put the class below together for use in a request/response flow. A memory channel seemed overkill for waiting on a single result to be dispatched from a coroutine that reads messages from the connection. I wanted …

---

## [Linux network namespaces](https://trio.discourse.group/t/linux-network-namespaces/512)

<div class="topic-metadata">

**Author:** [@Rationale](https://trio.discourse.group/u/Rationale)\
**Replies:** 3\
**Last updated:** [May 13, 2024, 2:26pm UTC](https://trio.discourse.group/t/linux-network-namespaces/512 "2024-05-13T14:26:46Z")

</div>

Hello All, I was looking at Trio and wondering if there is any support to switch to various network namespaces asynchronously and make tcp/websocket/http connections. Thanks, Sid

---

## [Different namespace http client](https://trio.discourse.group/t/different-namespace-http-client/513)

<div class="topic-metadata">

**Author:** [@Rationale](https://trio.discourse.group/u/Rationale)\
**Replies:** 0\
**Last updated:** [April 22, 2024, 11:32pm UTC](https://trio.discourse.group/t/different-namespace-http-client/513 "2024-04-22T23:32:44Z")

</div>

hi All, i realized i posted my question on the wrong thread. i’m looking to use trio but my main goal is to make multiple connections to various http servers or websocket servers on different linux network namespaces.…

---

## [Trio support for Cygwin under Windows 10/11](https://trio.discourse.group/t/trio-support-for-cygwin-under-windows-10-11/510)

<div class="topic-metadata">

**Author:** [@jicman](https://trio.discourse.group/u/jicman)\
**Replies:** 2\
**Last updated:** [March 30, 2024, 1:16am UTC](https://trio.discourse.group/t/trio-support-for-cygwin-under-windows-10-11/510 "2024-03-30T01:16:56Z")

</div>

Greetings! I installed trio using python3 under cygwin, but when I run a simple test program I get, $ python3 triotest.py Traceback (most recent call last): File "/home/E608313/p/python/triotest.py", line 2, in \<modu…

---

## [Do \`Cancelled\` exceptions "know" which block they belong to?](https://trio.discourse.group/t/do-cancelled-exceptions-know-which-block-they-belong-to/508)

<div class="topic-metadata">

**Author:** [@arthur-tacca](https://trio.discourse.group/u/arthur-tacca)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 1:09pm UTC](https://trio.discourse.group/t/do-cancelled-exceptions-know-which-block-they-belong-to/508 "2024-03-13T13:09:49Z")

</div>

The first paragraph of “Cancellation semantics” in the docs is this: You can freely nest cancellation blocks, and each Cancelled exception “knows” which block it belongs to. So long as you don’t stop it, the exception…

---

## [Structured concurrency resources](https://trio.discourse.group/t/structured-concurrency-resources/21)

<div class="topic-metadata">

**Author:** [@njs](https://trio.discourse.group/u/njs)\
**Replies:** 11\
**Last updated:** [February 27, 2024, 6:07am UTC](https://trio.discourse.group/t/structured-concurrency-resources/21 "2024-02-27T06:07:20Z")

</div>

This is a wiki post (anyone can edit) to collect links to articles and other resources about structured concurrency. It’s probably missing stuff – please add to it! Implementations C: libdill Python: Trio, anyio Kotlin…

---

## [Aioresult: Capture the result of a Trio or anyio task](https://trio.discourse.group/t/aioresult-capture-the-result-of-a-trio-or-anyio-task/462)

<div class="topic-metadata">

**Author:** [@arthur-tacca](https://trio.discourse.group/u/arthur-tacca)\
**Replies:** 1\
**Last updated:** [February 8, 2024, 4:30pm UTC](https://trio.discourse.group/t/aioresult-capture-the-result-of-a-trio-or-anyio-task/462 "2024-02-08T16:30:29Z")

</div>

In the spirit of “show off your work”, I present to you: aioresult, a tiny library for capturing the result of a task. Works with Trio directly, or also anyio but anyio isn’t required. From the docs: The main class of…

---

## [Effection: Structured Concurrency framework for JavaScript](https://trio.discourse.group/t/effection-structured-concurrency-framework-for-javascript/444)

<div class="topic-metadata">

**Author:** [@shamrin](https://trio.discourse.group/u/shamrin)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 7:52pm UTC](https://trio.discourse.group/t/effection-structured-concurrency-framework-for-javascript/444 "2023-12-18T19:52:58Z")

</div>

I’ve stumbled upon an interesting attempt to bring Structured Concurrency to JavaScript world. The implementation uses (non-async) generators: function\* and yield. GitHub - thefrontside/effection: Structured concurrenc…

---

## [Concurrency fuzzing](https://trio.discourse.group/t/concurrency-fuzzing/500)

<div class="topic-metadata">

**Author:** [@Anne\_Archibald](https://trio.discourse.group/u/Anne_Archibald)\
**Replies:** 1\
**Last updated:** [October 2, 2023, 2:15am UTC](https://trio.discourse.group/t/concurrency-fuzzing/500 "2023-10-02T02:15:36Z")

</div>

Async/await-style concurrency makes it harder to introduce deadlocks and concurrency-based bugs compared to thread-based concurrency. Nevertheless it is possible. I think it should be possible to systematically test for …

---

## [I ported Trio to Lua](https://trio.discourse.group/t/i-ported-trio-to-lua/496)

<div class="topic-metadata">

**Author:** [@sverm](https://trio.discourse.group/u/sverm)\
**Replies:** 0\
**Last updated:** [September 20, 2023, 7:46am UTC](https://trio.discourse.group/t/i-ported-trio-to-lua/496 "2023-09-20T07:46:28Z")

</div>

Trio has basically ruined me for using async programming in other languages given how good it is. So I might have to just port Trio to other languages that I find myself in, starting with Lua here:

---

## [Trio Event creation](https://trio.discourse.group/t/trio-event-creation/491)

<div class="topic-metadata">

**Author:** [@Tandleheart](https://trio.discourse.group/u/Tandleheart)\
**Replies:** 0\
**Last updated:** [August 24, 2023, 8:24pm UTC](https://trio.discourse.group/t/trio-event-creation/491 "2023-08-24T20:24:31Z")

</div>

I am learning the Trio API and ran into some surprising behavior (at least to me). It isn’t clearly stated in the Trio documentation, but is it true that a trio.Event() can only be created from within an event loop? Th…

---

## [Structured concurrency for GUI programming without concurrency!](https://trio.discourse.group/t/structured-concurrency-for-gui-programming-without-concurrency/488)

<div class="topic-metadata">

**Author:** [@cli345](https://trio.discourse.group/u/cli345)\
**Replies:** 0\
**Last updated:** [August 7, 2023, 6:01pm UTC](https://trio.discourse.group/t/structured-concurrency-for-gui-programming-without-concurrency/488 "2023-08-07T18:01:34Z")

</div>

Yes, many GUI programs are programmed sequentially and I pretend it may be easier to program them with structured concurrency! (I made real implementations of that in FuncSug, see Memory example and Hypertext fiction exa…

---

## [Signal handling for graceful termination](https://trio.discourse.group/t/signal-handling-for-graceful-termination/478)

<div class="topic-metadata">

**Author:** [@BeyondEvil](https://trio.discourse.group/u/BeyondEvil)\
**Replies:** 1\
**Last updated:** [June 14, 2023, 12:22pm UTC](https://trio.discourse.group/t/signal-handling-for-graceful-termination/478 "2023-06-14T12:22:05Z")

</div>

I have a small app that uses the Azure Service Bus Queue to pass around messages. I’d like the app to terminate gracefully on SIGTERM, meaning that it doesn’t fetch new messages from the queue and that it gets a chance …

---

## [ExceptionGroup migration](https://trio.discourse.group/t/exceptiongroup-migration/471)

<div class="topic-metadata">

**Author:** [@belm0](https://trio.discourse.group/u/belm0)\
**Replies:** 0\
**Last updated:** [March 22, 2023, 6:25am UTC](https://trio.discourse.group/t/exceptiongroup-migration/471 "2023-03-22T06:25:23Z")

</div>

cross-posting Zac-HD’s useful experience report on MultiError to ExceptionGroup migration

---

## [Python Trio and thread safety.](https://trio.discourse.group/t/python-trio-and-thread-safety/467)

<div class="topic-metadata">

**Author:** [@johnwt](https://trio.discourse.group/u/johnwt)\
**Replies:** 2\
**Last updated:** [March 21, 2023, 4:28am UTC](https://trio.discourse.group/t/python-trio-and-thread-safety/467 "2023-03-21T04:28:14Z")

</div>

Unfortunately, after looking at the Python Trio documentation, it is not clear to me, which items in the Trio API are thread safe. I know the documentation says “The vast majority of Trio’s API is not thread safe”. The…

[Next page](https://trio.discourse.group/latest.md?page=1)
