Closed si14 closed 3 weeks ago
I like spawn
, and use it heavily in my projects. I am not currently interested in dropping it.
Open to docs PRs.
I'm going to close this, but I am still open to docs PRs, or feel free to re-open if you'd like to discuss.
The
spawn
option is a bit unusual in how it works. Intuitively, it seems dangerous, since it doesn't surface the maximum number of tasks, so it might seem like it can exhaust resources. But of course it's limited bypool_size
and can error out withSpawnError::Busy
, and will do so by default if sent more than once in parallel (which is also not something I'd expect!).On the other hand, it can be substituted with a handler that sends a message to a channel that tasks are reading from.
I'm happy to take a stab at a note in the docs describing this nuance, but an alternative would be ditching
spawn
altogether, incentivising users to just use channels+prespawned tasks instead. What do you think?