Skip to content

Latest commit

 

History

History

basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

NATS : Basic Examples

These examples show the basics of using the NATS client.

Notes

  • NATS provides everything needed to publish and subcribe messages into the bus.
  • Sync, Async and Channels are supports.
  • You can create request/response constructs as well.

Code Review

Synchronous Messaging (Go Playground)
Asynchronous Messaging (Go Playground)
Channel Messaging (Go Playground)
Requests (Go Playground)
Queuing (Go Playground)

Exercises

Exercise 1

Write a program that has two goroutines playing a game of tennis. Pass the ball between the two goroutines using the NATS service. Pick a random number to determine if a goroutine missed the ball. Shut the program down cleanly once a goroutine loses.


All material is licensed under the Apache License Version 2.0, January 2004.