Skip to content

FUZD / @fuzd/server / RemoteSQLSchedulerStorage

Class: RemoteSQLSchedulerStorage<TransactionDataType> ​

Type Parameters ​

• TransactionDataType

Implements ​

Constructors ​

new RemoteSQLSchedulerStorage() ​

new RemoteSQLSchedulerStorage<TransactionDataType>(db): RemoteSQLSchedulerStorage<TransactionDataType>

Parameters ​

db ​

RemoteSQL

Returns ​

RemoteSQLSchedulerStorage<TransactionDataType>

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:122

Methods ​

archiveExecution() ​

archiveExecution(executionToStore): Promise<void>

Parameters ​

executionToStore ​

ScheduledExecutionQueued<TransactionDataType>

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.archiveExecution

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:161


claimDueExecutions() ​

claimDueExecutions(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Claim the due executions of a chain (not broadcast, checkinTime <= upToCheckinTime, earliest first) that no other run holds: in one atomic step, so two runs never get the same one. They stay the claimant's until it writes them (createOrUpdateQueuedExecution and archiveExecution release them), calls releaseExecutionClaims, or the claim expires (claim.expiresAt, unix ms). See docs/adr/0004-claim-due-items-with-a-lease.md.

Parameters ​

params ​
chainId ​

string

claim ​

{ by: string; expiresAt: number; now: number; }

claim.by ​

string

claim.expiresAt ​

number

claim.now ​

number

limit ​

number

upToCheckinTime ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.claimDueExecutions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:208


clear() ​

clear(): Promise<void>

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.clear

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:299


createOrUpdateQueuedExecution() ​

createOrUpdateQueuedExecution(executionToStore): Promise<ScheduledExecutionQueued<TransactionDataType>>

Parameters ​

executionToStore ​

ScheduledExecutionQueued<TransactionDataType>

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>>

Implementation of ​

SchedulerStorage.createOrUpdateQueuedExecution

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:175


deleteExecution() ​

deleteExecution(params): Promise<void>

Parameters ​

params ​
account ​

`0x${string}`

chainId ​

string

slot ​

string

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.deleteExecution

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:152


deleteFinalizedScheduledExecutions() ​

deleteFinalizedScheduledExecutions(params): Promise<void>

Parameters ​

params ​
chainId ​

string

upTo ​

number

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.deleteFinalizedScheduledExecutions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:286


getAccountArchivedSubmissions() ​

getAccountArchivedSubmissions(account, params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

account ​

`0x${string}`

params ​
limit ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getAccountArchivedSubmissions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:276


getAccountSubmissions() ​

getAccountSubmissions(account, params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

account ​

`0x${string}`

params ​
limit ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getAccountSubmissions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:266


getAllExecutions() ​

getAllExecutions(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

params ​
limit ​

number

order ​

"ASC" | "DESC"

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getAllExecutions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:256


getQueuedExecution() ​

getQueuedExecution(params): Promise<undefined | ScheduledExecutionQueued<TransactionDataType>>

Parameters ​

params ​
account ​

`0x${string}`

chainId ​

string

slot ​

string

Returns ​

Promise<undefined | ScheduledExecutionQueued<TransactionDataType>>

Implementation of ​

SchedulerStorage.getQueuedExecution

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:124


getQueuedExecutionsForAccount() ​

getQueuedExecutionsForAccount(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

params ​
account ​

`0x${string}`

chainId ​

string

limit ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getQueuedExecutionsForAccount

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:139


getQueueTopMostExecutions() ​

getQueueTopMostExecutions(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

The queued (not yet broadcast) executions with the earliest checkin time first. chainId restricts them to one chain, upToCheckinTime to those due at that time.

Parameters ​

params ​
chainId ​

string

limit ​

number

upToCheckinTime ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getQueueTopMostExecutions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:187


getUnFinalizedBroadcastedScheduledExecutions() ​

getUnFinalizedBroadcastedScheduledExecutions(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

params ​
limit ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getUnFinalizedBroadcastedScheduledExecutions

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:234


getUnFinalizedScheduledExecutionsPerBroadcaster() ​

getUnFinalizedScheduledExecutionsPerBroadcaster(params): Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Parameters ​

params ​
broadcaster ​

`0x${string}`

chainId ​

string

limit ​

number

Returns ​

Promise<ScheduledExecutionQueued<TransactionDataType>[]>

Implementation of ​

SchedulerStorage.getUnFinalizedScheduledExecutionsPerBroadcaster

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:243


releaseExecutionClaims() ​

releaseExecutionClaims(claimant): Promise<void>

Release whatever claimant still holds (its run is over).

Parameters ​

claimant ​

string

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.releaseExecutionClaims

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:227


setup() ​

setup(): Promise<void>

Returns ​

Promise<void>

Implementation of ​

SchedulerStorage.setup

Defined in ​

packages/server/src/storage/RemoteSQLSchedulerStorage.ts:305