@codesoul-co/hypha-core / contracts/runtime-timer
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/runtime-timer.ts - Exports: 6
Using this module
Use the Runtime timer module for declaring and runtime-validating contracts. It exports 1 constant, 4 interfaces, 1 type.
Import from the package entrypoint
ts
import {
RUNTIME_TIMER_SWEEP_DISPOSITIONS,
} from '@codesoul-co/hypha-core';
import type {
RuntimeTimerStreamScope,
RuntimeTimerSweepRequest,
RuntimeTimerSweepResult,
RuntimeTimerSweepRunResult,
RuntimeTimerSweepDisposition,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 5 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
RUNTIME_TIMER_SWEEP_DISPOSITIONS | constant | const RUNTIME_TIMER_SWEEP_DISPOSITIONS: readonly ["fired", "not_due", "lease_unavailable", "already_resolved"] | RUNTIME TIMER SWEEP DISPOSITIONS constant exported by the contracts/runtime-timer module. |
RuntimeTimerStreamScope | interface | interface RuntimeTimerStreamScope | Runtime Timer Stream Scope interface with 3 public fields or methods. |
RuntimeTimerSweepRequest | interface | interface RuntimeTimerSweepRequest | Runtime Timer Sweep Request interface with 5 public fields or methods. |
RuntimeTimerSweepResult | interface | interface RuntimeTimerSweepResult | Runtime Timer Sweep Result interface with 7 public fields or methods. |
RuntimeTimerSweepRunResult | interface | interface RuntimeTimerSweepRunResult | Runtime Timer Sweep Run Result interface with 3 public fields or methods. |
RuntimeTimerSweepDisposition | type | type RuntimeTimerSweepDisposition = (typeof RUNTIME_TIMER_SWEEP_DISPOSITIONS)[number] | Public type alias for Runtime Timer Sweep Disposition; the declaration contains its complete type expression. |
RUNTIME_TIMER_SWEEP_DISPOSITIONS
RUNTIME TIMER SWEEP DISPOSITIONS constant exported by the contracts/runtime-timer module.
- Kind: constant
- Import:
import { RUNTIME_TIMER_SWEEP_DISPOSITIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export declare const RUNTIME_TIMER_SWEEP_DISPOSITIONS: readonly ["fired", "not_due", "lease_unavailable", "already_resolved"];RuntimeTimerStreamScope
Runtime Timer Stream Scope interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeTimerStreamScope } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export interface RuntimeTimerStreamScope {
tenantId?: string;
userId: string;
runId: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
tenantId | property | tenantId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
userId | property | userId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeTimerSweepRequest
Runtime Timer Sweep Request interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeTimerSweepRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export interface RuntimeTimerSweepRequest {
ownerId: string;
leaseTtlMs: number;
limit: number;
cursor?: string;
firedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
cursor | property | cursor?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
firedAt | property | firedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseTtlMs | property | leaseTtlMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
limit | property | limit: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
ownerId | property | ownerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeTimerSweepResult
Runtime Timer Sweep Result interface with 7 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeTimerSweepResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export interface RuntimeTimerSweepResult {
scanned: number;
fired: number;
notDue: number;
leaseUnavailable: number;
alreadyResolved: number;
results: RuntimeTimerSweepRunResult[];
nextCursor?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
alreadyResolved | property | alreadyResolved: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
fired | property | fired: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseUnavailable | property | leaseUnavailable: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
nextCursor | property | nextCursor?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
notDue | property | notDue: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
results | property | results: RuntimeTimerSweepRunResult[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
scanned | property | scanned: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeTimerSweepRunResult
Runtime Timer Sweep Run Result interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeTimerSweepRunResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export interface RuntimeTimerSweepRunResult {
scope: RuntimeTimerStreamScope;
disposition: RuntimeTimerSweepDisposition;
eventIds: string[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
disposition | property | disposition: "lease_unavailable" | "fired" | "not_due" | "already_resolved" | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventIds | property | eventIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeTimerStreamScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeTimerSweepDisposition
Public type alias for Runtime Timer Sweep Disposition; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeTimerSweepDisposition } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-timer
Declaration
text
export type RuntimeTimerSweepDisposition = (typeof RUNTIME_TIMER_SWEEP_DISPOSITIONS)[number];