SqliteDeliveryTrackingStore
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:36
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SqliteDeliveryTrackingStore(
options?):SqliteDeliveryTrackingStore
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:41
Parameters
Section titled “Parameters”options?
Section titled “options?”SqliteDeliveryTrackingStoreOptions = {}
Returns
Section titled “Returns”SqliteDeliveryTrackingStore
Methods
Section titled “Methods”close()
Section titled “close()”close():
void
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:145
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”countBy()
Section titled “countBy()”countBy(
filter,groupBy):Promise<DeliveryTrackingCountByRow[]>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:131
Parameters
Section titled “Parameters”filter
Section titled “filter”groupBy
Section titled “groupBy”readonly DeliveryTrackingCountByField[]
Returns
Section titled “Returns”Promise<DeliveryTrackingCountByRow[]>
Implementation of
Section titled “Implementation of”countRecords()
Section titled “countRecords()”countRecords(
filter):Promise<number>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:127
Parameters
Section titled “Parameters”filter
Section titled “filter”Returns
Section titled “Returns”Promise<number>
Implementation of
Section titled “Implementation of”DeliveryTrackingStore.countRecords
get(
messageId):Promise<TrackingRecord|undefined>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:89
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
Returns
Section titled “Returns”Promise<TrackingRecord | undefined>
Implementation of
Section titled “Implementation of”init()
Section titled “init()”init():
Promise<void>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:81
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”leaseDue()
Section titled “leaseDue()”leaseDue(
now,limit,leaseUntil):Promise<TrackingRecord[] |undefined>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:97
Like listDue, but also leases the records it returns: in the same
atomic step their nextCheckAt moves to leaseUntil, so other pollers
of the store skip them until the poll stores their next check or the
lease runs out. It resolves undefined when this store cannot lease
atomically. DeliveryTrackingService leases only with a store that has
both this and patchLeased, and otherwise uses listDue.
Parameters
Section titled “Parameters”Date
number
leaseUntil
Section titled “leaseUntil”Date
Returns
Section titled “Returns”Promise<TrackingRecord[] | undefined>
Implementation of
Section titled “Implementation of”DeliveryTrackingStore.leaseDue
listDue()
Section titled “listDue()”listDue(
now,limit):Promise<TrackingRecord[]>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:93
Parameters
Section titled “Parameters”Date
number
Returns
Section titled “Returns”Promise<TrackingRecord[]>
Implementation of
Section titled “Implementation of”listRecords()
Section titled “listRecords()”listRecords(
options):Promise<TrackingRecord[]>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:121
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<TrackingRecord[]>
Implementation of
Section titled “Implementation of”DeliveryTrackingStore.listRecords
patch()
Section titled “patch()”patch(
messageId,patch):Promise<void>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:138
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
Partial<TrackingRecord>
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”patchLeased()
Section titled “patchLeased()”patchLeased(
messageId,leaseUntil,patch):Promise<boolean>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:105
Applies patch only while the record is still leased until leaseUntil
(its nextCheckAt equals it), and resolves whether it did. The check
and the write are one atomic step, as in leaseDue. A poll stores its
results this way, so one that ran past its lease cannot overwrite what
another poll stored since.
Parameters
Section titled “Parameters”messageId
Section titled “messageId”string
leaseUntil
Section titled “leaseUntil”Date
Partial<TrackingRecord>
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”DeliveryTrackingStore.patchLeased
releaseLeases()
Section titled “releaseLeases()”releaseLeases(
messageIds,leaseUntil,nextCheckAt):Promise<void>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:113
Hands back leases a poll did not finish: moves nextCheckAt to the
given time on those records whose nextCheckAt is still leaseUntil.
A record another poll has leased since is left alone. Without it,
DeliveryTrackingService lets such leases run out.
Parameters
Section titled “Parameters”messageIds
Section titled “messageIds”readonly string[]
leaseUntil
Section titled “leaseUntil”Date
nextCheckAt
Section titled “nextCheckAt”Date
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”DeliveryTrackingStore.releaseLeases
upsert()
Section titled “upsert()”upsert(
record):Promise<void>
Defined in: packages/messaging/src/delivery-tracking/stores/sqlite.store.ts:85
Parameters
Section titled “Parameters”record
Section titled “record”Returns
Section titled “Returns”Promise<void>