Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NC *nats.Conn
NC is a connection to the nats Server
Functions ¶
func Connect ¶
Connect connects to nats server and returns instance On shutdown, you'll need to call natsconnection.NC.Drain()
func Request ¶
func Request(ctx context.Context, subj string, data []byte, timeOut time.Duration) (*nats.Msg, error)
Request sends a message and expects a response back
func SubscribeToQueue ¶
SubscribeToQueue subscribes on a NATS channel subj is the channel to subscribe on queueName, if specified joins the queue so each message is only received by one running container all containers subscribed to a specified subj receive the message unless in a queueName, then only one in each queueName receives the message nats.Msg has the subj in it, so we can do routing from there
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.