> Is it safe to send messages from a single producer thread to multiple 
> consumer threads using a single channel? Or would separate channels be 
> required, one for producer-consumer thread pair?

Channels are for passing a message with a single owner, a producer and a 
consumer. There are single-producer, multi-consumer channels but it's when any 
consumer can handle the message, not all consumers must handle the message, for 
example a task/job system where any CPU can handle the task.

What you seem to be looking for is a pubsub / publish-subscribe system or an 
event bus.

> Also, if using spawn, what's the alternative to channels?

Channels are for `spawn` situations.

Reply via email to