A ulitity package to enable Channel-based subscriptions in your golang code.
It enables "event-driven" approach in your application.
It has runtime check including when the subscribers provide invalid parameter.
go get gitlab.com/altiano/cnator
cnator := cnator.New()
channels := createChannels()
// provide channel reference to each publisher
producerA := NewProducerA(channels.chanA)
producerB := NewProducerB(channels.chanB)
producerC := NewProducerC(channels.chanC)
// using cnator to subscribe to those channel events
subscriberA := subscriberA{}
subscriberB := subscriberB{}
subscriberC := subscriberC{}
cnator.Subscribe(channels.chanA, subscriberA.receiveChanA)
cnator.Subscribe(channels.chanB, subscriberB.receiveChanB)
cnator.Subscribe(channels.chanC, subscriberC.receiveChanC)
- Tracing visibility of every calls happen in subscriptions. Useful for debugging.
- Supports channels to shared by multiple
Cnator
instances
Photo by Gabriella Clare Marino on Unsplash