Repository navigation
PushDispatcher
Viames Marino edited this page Feb 22, 2026
·
1 revision
Pair\Push\PushDispatcher sends a notification to all active subscriptions of a user.
It coordinates:
-
SubscriptionRepository(load subscriptions) -
WebPushSender(deliver notification) - automatic cleanup of invalid endpoints
use Pair\Push\PushDispatcher;
use Pair\Push\Notification;
$dispatcher = new PushDispatcher();
$notification = new Notification(
'Order updated',
'Your order #123 has been shipped',
'/orders/123',
'/img/icon.png',
'order-123'
);
$results = $dispatcher->sendToUser(42, $notification);sendToUser() returns a list of DeliveryResult objects, one per subscription.
- fetches all non-revoked subscriptions for user
- sends one push per subscription
- if provider returns
404or410, subscription is deleted
See also: SubscriptionRepository, WebPushSender, VapidConfig, PairPush.js.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4