I'm coming from a background in Golang and Rust. In those languages I would often spawn long-running tasks that generate messages to be consumed. I'm specifically referring to Golang channels and Rust's mpsc.
I was thinking that you might implement it as an Actor but some features that would desirable don't seem to fit into the Actor model.
Tokio, a library for Rust, has an mpsc implementation that has a try_send function. This is a synchronous function that errors out when the queue is full. This is useful for queuing messages when its unacceptable to block and when messages can be dropped. Does anyone have any thoughts for how something like this could be implemented in Swift?