Skip to content

Files

Latest commit

4241a87 · May 13, 2025

History

History

notification

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 13, 2025
Jan 13, 2025

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 the 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!"}}'