The "Neural Autonomic Transport System", a cross-platform messaging technology.
Learn the basics of Python async:
For further information, refer to the asyncio documentation.
-
Have a look at NATS : Connective Technology for Adaptive Edge & Distributed Systems,
-
Install the official NATS Python client and tools,
-
Test the NATS client with
01_hello_world.py(demo server), -
Install and start the NATS server binary/service,
-
Adapt hello world to test your local NATS server.
Learn the basics of the NATS Python client API:
-
connect -
subscribe -
publish -
SubscriptionandSubscription.next_msg, -
Message,Message.dataandMessage.reply.
-
Identity. Select an name to identify yourself (e.g.
boisgerafor myself). -
Heartbeat. Send every second a message with subject
"❤️"and with data your (utf-8 encoded) name. -
Alive Create a python file with an async function
alivethat list (once, alphabetically) each name that has at least one heartbeat over a 3.0 second. Print each name on a line when the python file is invoked as a script. -
Watcher. Use rich to make a script that continuously display the list of heartbeat names.
-
Inbox. Subscribe to the channel which is your name and print every message that you receive in this channel. Combine this program with the publication of your heartbeat.
-
Greetings. Send a (utf-8 encoded) greeting message to a person who has a heartbeat.
-
Reply. Send another message to someone with a specific question. Specify the
replyargument topublishin order to get an answer! -
Replies. There are several way to identify among all the messages that you get which one correspond to the answer to a specific message you get. One way consists in using an ephemeral channel which you will use only for this answer, and specify its (uniquely generated name) in the
replyargument. -
JSON. Make some NATS server to provide access to search Chuck Norris Jokes and also make the corresponding client.
