A simple PubSub library written in Golang.
Check out the Developer Diary to learn more of how I've developed this little project.
- Create initial architecture sketch.
- Create initial package without generics or use of files.
- Add file management.
- Add Generics.
First you must create a Pub/Sub agent:
pubSub := pubsub.CreatePubSub()
After that you can create queues, subscribe and publish string data:
pubSub.CreateQueue("my_queue")
sub, err := pubSub.Subscribe("my_queue")
err = pubSub.Publish("my_queue", message)
You can also add a logger to the agent, which will create a logging file for each queue with timestamps:
err := pubSub.AddLogger()
Check out the examples to learn more.