msgq

I created this to play around with channels in Go. It should not be considered production ready. This package is intended to be as general and adaptable as possible, so it provides very little in the way of specific features.
Example
type ExampleMessage struct {
Id string
Content string
Time time.Time
}
func (e ExampleMessage) UpdateAt() time.Time {
return e.Time
}
func (e ExampleMessage) ContentId() string {
return e.Id
}
func (e ExampleMessage) Publish() error {
fmt.Println(e.Content)
return nil
}
type ExampleErrorHandler struct{}
func (e ExampleErrorHandler) HandleError(err error, msg msgq.Message) {
fmt.Println(err.Error(), msg)
}
func main() {
MsgQ := msgq.New()
listenChan, done := MsgQ.Run()
source := []ExampleMessage{{"1","content", time.Now().Add(time.Second)}, {"2", "content 2", time.Now()}}
for _, msg := range source {
listenChan <- msg
}
time.Sleep(3*time.Second)
close(listenChan)
<- done
}