Skip to content

Instantly share code, notes, and snippets.

View jsokel's full-sized avatar

John Sokel jsokel

  • Journera
  • Chicago, IL
View GitHub Profile
@jsokel
jsokel / tasks.go
Last active April 13, 2017 20:51
Snippet of GO SQS processor
func (t *Tasks) consumerLoop() {
ConsumerLoop:
for {
select {
case msg := <-t.consumer.MessageChan():
t.processMessage(msg)
case <-t.closer.NotifyChan():
break ConsumerLoop
}
@jsokel
jsokel / sqs_publisher.go
Created April 13, 2017 14:49
A simple generic GO SQS publisher
package queue
import (
"encoding/base64"
"encoding/json"
log "github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/aws/aws-sdk-go/service/sqs/sqsiface"
"reflect"