If one incoming HTTP request should be sent to 5 workers async,
See *solution #5* for similar problem/solution -
http://rodaine.com/2015/04/async-split-io-reader-in-golang/ .
A video file is required to be processed in multiple formats where
io.MultiWriter is used to send all data asynchronously which are being
processed in separate Go routines.

You can use https://golang.org/pkg/io/#example_MultiWriter to copy the
content from the reader so that all 5 processes can read the content.

PubSub approach is suggested (as suggested in the previous thread) if you
are looking for a production/stable system.
There is *Kafka* in Go (https://github.com/travisjeffery/jocko) in case you
want to skip external deps (spec not fully complete).

- Sairam


On Wed, Feb 1, 2017 at 3:40 AM, Paweł Szczur <pawelszc...@gmail.com> wrote:

> I read whole request body. Pack to some structure. Send to a message queue
> (RabbitMQ, Kafka, Google Pub/Sub). MQ services allow to configure a
> topic/channel to multiplex a msg to all receivers (in PubSub you would
> create multiple subscriptions for a given topic https://cloud.google.com/
> pubsub/architecture#the_basics_of_a_publishsubscribe_service).
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to