Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 856 Bytes

README.md

File metadata and controls

32 lines (19 loc) · 856 Bytes

Notification Center

This example demonstrates how to implement a notification center to send and receive notifications.

Prerequisites

Quick Start

Using NATS Runtime

Start a notification center in one terminal:

python examples/notification/notification.py

Then create a subscription via a proxy agent in another terminal:

coagent proxy -H type:Subscribe --stream --filter .content -d '{"user_id": "1"}'

Finally, send a notification to the center agent in a third terminal, and then observe the output in the second terminal:

coagent center:singleton -H type:Notify -d '{"user_id": "1", "notification": {"type": "created", "content": "Hello, world!"}}'