Structured Concurrency in Ruby

I don’t really know how to reply to this, so let me start by thanking you for your work, which has been a tremendous inspiration to me. My own little adventure in this field owes a lot to Trio.

I understand your argument, but my interest in the concept of “structured concurrency” is practical rather than theoretical. For me, structured concurrency means: “a concurrent task is guaranteed to terminate before its parent task does”. That said, I understand that the idea is that the source code clearly express where a concurrent task begins and where it ends. At least I got the error propagation stuff right (I think). :wink:

I guess I can come up with some control-flow constructs that fulfill those requirements. But there’s two things I’d like to avoid: passing a nursery object to any method that wants to spin up a fiber, and building an entire layer of abstraction that prevents Polyphony from being integrated with other legacy Ruby code. I’d prefer Polyphony be useful rather than correct.

Frankly, I’m totally fine with you saying what I’m doing is not structured concurrency. As I said, I don’t really know how to react to this. I might call it “unpure structured concurrency”, “inspired by structured concurrency”, or just continue calling it “structured concurrency” and note that it doesn’t really adhere to the prescribed maxims of structured concurrency. Let me think about it. :slight_smile: