connect()
connect() constructs Pulse immediately and creates one background readiness promise. Use awaitConnection() during application startup to surface connection, permission, and index errors before accepting traffic.
Connection options
Strings must be non-empty.
maxPoolSize must be a positive integer. Durations and worker counts must be finite positive numbers, except retention, retry counts, and retry delays may be zero where their types allow it. Retry settings are rejected when their largest computed delay falls outside MongoDB’s supported date range.
Pulse sets the MongoDB driver’s maxPoolSize to 5 instead of its default of 100. minPoolSize
remains at the driver default of 0, so the pool grows on demand. The limit applies to application
connections in each server pool; the driver also opens monitoring connections for the MongoDB
topology.
pulse.awaitConnection()
publish(), subscribe(), and history.find() call it internally.
pulse.publish()
_id is a UUIDv7 string. Pulse never uses MongoDB ObjectId for its own documents.
pulse.subscribe()
Subscription options
The handler can return
void or Promise<void>:
PulseReceivedEvent contains every published event field plus consumerGroup and the one-based attempt number.
The returned subscription contains the resolved options and an idempotent asynchronous unsubscribe() method.
pulse.getSubscriptions()
pulse.history.find()
History filters
Results are sorted by UUIDv7
_id descending:
pulse.close()
Exported errors
Collections
The names usecollectionPrefix, which defaults to orionjs.pulse:
Every Pulse-created
_id, lock owner, and fencing token is a UUIDv7 string.