Skip to content

Utils for trigger NATS handlers in the separate goroutines

License

Notifications You must be signed in to change notification settings

pamelin/go-nats-parallel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-nats-parallel

Utils library for go-nats.

This library provides a bunch of helper subscribe functions which will invoke nats handlers in the separate goroutines.

Use this library if you require parallel processing of the incoming messages in the non-blocking fashion.

Basic Usage

ec, _ := natsll.NewEncodedJsonConn(nats.DefaultURL)
defer nc.Close()


natsll.SubscribeEc(ec, "foo", func(s string){
    fmt.Printf("Received a message: %s\n", s)
    time.Sleep(5 * time.Second) // let's dance
})

ec.Publish("foo", "Hello World")
ec.Publish("foo", "Hello World")
ec.Publish("foo", "Hello World")

About

Utils for trigger NATS handlers in the separate goroutines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages