Idiomatic queues for different providers.
Goku tries to unify queue interaction (currently only SQS is supported only),
by using channels.
First, you need to initialize the library, specifying a provider, in this case
sqs_provider
is a goamz/SQS instance.
q := goku.NewQueue(
goku.Reader(sqs_provider),
goku.Writer(sqs_provider),
)
goku.Queue
will expose two channels, one for reading messages Sender()
,
and one for writing messages Receiver()
.
After that, you should be able to exchange messages with the queue as follow:
q.Receiver() <- "Message"
msg := <-q.Sender()
For more information, please read the example.