Quick Start
Agent-Centric Example
How It Works
| Component | Purpose |
|---|---|
| PushClient | Client SDK with auto-reconnect and transport fallback |
| WebSocket | Primary real-time transport |
| HTTP Polling | Fallback transport for restricted networks |
| Channels | Named message streams for pub/sub |
| Presence | Track online/offline status of clients |
| Delivery Guarantees | At-least-once message delivery with ACKs |
Configuration Options
PushConfig
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | False | Feature toggle (push is opt-in; zero overhead when disabled) |
redis | Optional[RedisConfig] | None | Redis config for cross-server scaling |
presence | PresenceConfig | PresenceConfig() | Presence tracking settings |
delivery | DeliveryConfig | DeliveryConfig() | Delivery guarantee settings |
polling | PollingConfig | PollingConfig() | Polling fallback settings |
RedisConfig
| Option | Type | Default | Description |
|---|---|---|---|
url | Optional[str] | None | Full Redis URL (takes precedence over host/port) |
host | str | "localhost" | Redis host |
port | int | 6379 | Redis port |
db | int | 0 | Redis database number |
password | Optional[str] | None | Redis password |
prefix | str | "praison:push:" | Key prefix namespace |
max_connections | int | 20 | Connection pool size |
PresenceConfig
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | True | Toggle presence tracking |
heartbeat_interval | int | 15 | Expected heartbeat frequency (seconds) |
offline_timeout | int | 45 | Mark offline after this many seconds without heartbeat |
broadcast_changes | bool | True | Broadcast presence changes to subscribed channels |
DeliveryConfig
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | True | Toggle delivery guarantees |
ack_timeout | int | 30 | Seconds to wait for ACK before retrying |
max_retries | int | 3 | Maximum retry attempts |
retry_backoff | float | 2.0 | Exponential backoff multiplier |
message_ttl | int | 86400 | How long to retain unacknowledged messages (seconds) |
store_backend | str | "memory" | "memory" or "redis" |
PollingConfig
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | True | Toggle polling fallback |
long_poll_timeout | int | 30 | Long-poll hang duration (seconds) |
max_batch_size | int | 100 | Max messages per poll response |
Common Patterns
Publish/Subscribe
One-shot Wait
Presence Tracking
Best Practices
When to Enable Redis
When to Enable Redis
Enable Redis when running multiple gateway servers that need to share push channels:Without Redis, channels only exist on a single gateway instance.
Choosing Delivery Store Backend
Choosing Delivery Store Backend
Use Use
memory for low-latency scenarios where message loss on restart is acceptable:redis for high-availability scenarios where messages must survive server restarts:Tuning Heartbeat and Timeout
Tuning Heartbeat and Timeout
Adjust based on network conditions and desired responsiveness:
When Polling Fallback Matters
When Polling Fallback Matters
Polling is crucial for corporate firewalls and mobile networks that block WebSocket connections:Clients automatically switch to HTTP polling if WebSocket connection fails.
Choosing a Transport
Related
Gateway
The gateway that hosts push notification channels
A2A Push Notifications
Webhook-based task updates (different from real-time channels)

