Skip to main content

Module notifications

Module notifications 

Source
Expand description

Solid Notifications Protocol (0.2) — Phase 2 implementation.

Ships both WebSocketChannel2023 and WebhookChannel2023 channel types on top of a broadcast::Sender<StorageEvent> fed by the Storage::watch() method added in Phase 1.

Reference: https://solid.github.io/notifications/protocol/

Payload shape (per spec §7, Activity Streams 2.0 on JSON-LD):

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "urn:uuid:...",
  "type": "Create" | "Update" | "Delete",
  "object": "https://pod.example.com/path",
  "published": "2025-04-20T12:00:00Z"
}

Modules§

as_ns
as: type URIs per Activity Streams 2.0.

Structs§

ChangeNotification
Activity Streams 2.0 change notification payload.
InMemoryNotifications
Subscription
A single subscription record.
WebSocketChannelManager
WebSocket-based notification channel. The manager maintains the list of subscriptions and emits serialised change notifications on a tokio::sync::broadcast channel that upstream HTTP servers attach WebSocket tasks to.
WebhookChannelManager
Webhook notification channel with built-in retry logic. The manager keeps an internal map of subscriptions → target URL, and deliver_all() POSTs the Activity Streams payload to each target.

Enums§

ChannelType
Channel type advertised by .notifications discovery.
WebhookDelivery
Outcome of a webhook delivery attempt.

Traits§

Notifications
Public trait for notification backends.

Functions§

discovery_document
Build the subscription-discovery JSON-LD document served at .notifications per the Notifications Protocol §5.