콘텐츠로 이동

DeliveryTrackingService

Defined in: packages/messaging/src/delivery-tracking/service.ts:231

new DeliveryTrackingService(config): DeliveryTrackingService

Defined in: packages/messaging/src/delivery-tracking/service.ts:251

DeliveryTrackingServiceConfig

DeliveryTrackingService

close(): Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:310

Stops polling and closes the store. A poll in progress, including one still setting up the store, stops as if its signal had aborted, and close() waits for it to store the statuses it has before closing the store; status changes still being delivered to onStatusChange are not waited for. The service does not poll again.

Promise<void>


countBy(filter, groupBy): Promise<DeliveryTrackingCountByRow[]>

Defined in: packages/messaging/src/delivery-tracking/service.ts:418

DeliveryTrackingRecordFilter

readonly DeliveryTrackingCountByField[]

Promise<DeliveryTrackingCountByRow[]>


countRecords(filter): Promise<number>

Defined in: packages/messaging/src/delivery-tracking/service.ts:412

DeliveryTrackingRecordFilter

Promise<number>


getRecord(messageId): Promise<TrackingRecord | undefined>

Defined in: packages/messaging/src/delivery-tracking/service.ts:399

string

Promise<TrackingRecord | undefined>


init(): Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:279

Promise<void>


listRecords(options): Promise<TrackingRecord[]>

Defined in: packages/messaging/src/delivery-tracking/service.ts:404

DeliveryTrackingListOptions

Promise<TrackingRecord[]>


recordSend(context, result): Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:319

HookContext

SendResult

Promise<void>


runOnce(request?): Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:450

Polls the records that are due once, or joins a poll already running. It resolves once the poll’s status changes have been delivered to onStatusChange. A callback may call it too, as may a callback of another service: while this service is delivering, such a call resolves once the poll’s changes are queued, since they may be delivered after the callback. Work a callback starts without awaiting it counts as the callback’s.

A runtime without AsyncLocalStorage, such as Workers without nodejs_compat on older compatibility dates, cannot tell those calls from others. There, a poll that ends while callbacks run delivers its changes at once, beside them rather than after them, and every call waits until its changes are delivered.

request goes to each status query of the poll this call starts, as KMsg.send() passes it to the provider: a signal to cancel it and a fetch to make it with. The signal also bounds the poll: once it aborts, no more queries start, those still running are cancelled, and the poll stores the statuses it has and ends. The records it did not finish stay due. A call that joins a poll already running stops waiting for it when its own signal aborts. After close(), it does nothing.

ProviderRequestContext

Promise<void>


start(): void

Defined in: packages/messaging/src/delivery-tracking/service.ts:283

void


stop(): void

Defined in: packages/messaging/src/delivery-tracking/service.ts:297

void