๐Ÿ“ฌ

Notification Dashboard

postal pub/sub & wiretap demo

Services

Click a button to publish an event

Users
Orders
Payments
System

Subscriptions

Toggle patterns on/off โ€” each calls subscribe() or unsubscribe()

Notification Feed

Messages matching active subscriptions

0
๐Ÿ””

Activate a subscription chip
and click a service button

Wiretap (firehose)

All messages โ€” subscriptions don't filter this

0
๐Ÿ“ก

Click any service button
to see raw bus traffic

How postal makes this work

This dashboard is entirely in-memory โ€” no servers, no workers, no transports. Just postal's core pub/sub API showing what it can do before you add any cross-boundary infrastructure.

Channel-scoped messaging

All messages flow through a single channel created with getChannel("notifications"). Channels scope messaging to a named domain โ€” every publish(), subscribe(), and wiretap operates within that scope. Multiple channels can coexist without interfering.

Wildcard subscriptions

Each subscription chip calls channel.subscribe(pattern, callback) with an AMQP-style wildcard topic. * matches exactly one segment โ€” orders.* catches orders.created but not payments.refund.initiated. # matches zero or more โ€” system.# catches everything under system.

Live subscribe / unsubscribe

Toggling a chip calls the real API โ€” not a filter flag. Deactivating calls the unsubscribe() function returned by the previous subscribe() call. Reactivating calls subscribe() again and stores the new unsubscribe function. The notification feed immediately reflects the change.

Wiretap โ€” global observer

addWiretap(callback) registers a global observer that receives every envelope published to the bus โ€” regardless of channel, topic, or active subscriptions. The wiretap fires for messages that match subscriptions AND messages that don't. This is the "firehose" view. Wiretap errors are swallowed so observers can't break dispatch.