@codesoul-co/hypha-memory / lifecycle-workers
模块用法
用于使用该功能边界的公共契约与操作。Lifecycle workers 模块公开 8 类、5 接口、2 类型。
从包入口导入
import {
InMemoryMemoryLifecycleTaskStore,
LeasedMemoryLifecycleWorker,
MemoryConsolidationWorker,
MemoryDecayWorker,
MemoryDeletionWorker,
MemoryReindexWorker,
MemoryRetentionWorker,
ProviderReconciliationWorker,
} from '@codesoul-co/hypha-memory';
import type {
MemoryLifecycleTask,
MemoryLifecycleTaskStore,
MemoryLifecycleWorkerEvent,
MemoryLifecycleWorkerOptions,
MemoryLifecycleWorkerRunResult,
MemoryLifecycleTaskHandler,
MemoryLifecycleWorkerType,
} from '@codesoul-co/hypha-memory';使用要点
- 7 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用
import type,运行时不应依赖它们。 - 8 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
InMemoryMemoryLifecycleTaskStore | 类 | new InMemoryMemoryLifecycleTaskStore(): InMemoryMemoryLifecycleTaskStore | In Memory Memory Lifecycle Task Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。 |
LeasedMemoryLifecycleWorker | 类 | new LeasedMemoryLifecycleWorker(options: MemoryLifecycleWorkerOptions): LeasedMemoryLifecycleWorker | Leased Memory Lifecycle Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryConsolidationWorker | 类 | new MemoryConsolidationWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryConsolidationWorker | Memory Consolidation Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryDecayWorker | 类 | new MemoryDecayWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryDecayWorker | Memory Decay Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryDeletionWorker | 类 | new MemoryDeletionWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryDeletionWorker | Memory Deletion Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryReindexWorker | 类 | new MemoryReindexWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryReindexWorker | Memory Reindex Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryRetentionWorker | 类 | new MemoryRetentionWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryRetentionWorker | Memory Retention Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
ProviderReconciliationWorker | 类 | new ProviderReconciliationWorker(options: Omit<MemoryLifecycleWorkerOptions, "type">): ProviderReconciliationWorker | Provider Reconciliation Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryLifecycleTask | 接口 | interface MemoryLifecycleTask | Memory Lifecycle Task 接口,共包含 15 个公开字段或方法。 |
MemoryLifecycleTaskStore | 接口 | interface MemoryLifecycleTaskStore | Memory Lifecycle Task Store 接口,共包含 6 个公开字段或方法。 |
MemoryLifecycleWorkerEvent | 接口 | interface MemoryLifecycleWorkerEvent | Memory Lifecycle Worker Event 接口,共包含 5 个公开字段或方法。 |
MemoryLifecycleWorkerOptions | 接口 | interface MemoryLifecycleWorkerOptions | Memory Lifecycle Worker Options 接口,共包含 12 个公开字段或方法。 |
MemoryLifecycleWorkerRunResult | 接口 | interface MemoryLifecycleWorkerRunResult | Memory Lifecycle Worker Run Result 接口,共包含 4 个公开字段或方法。 |
MemoryLifecycleTaskHandler | 类型 | type MemoryLifecycleTaskHandler = (task: MemoryLifecycleTask, signal: AbortSignal) => Promise<void> | Memory Lifecycle Task Handler 公共类型别名;完整类型表达式见声明。 |
MemoryLifecycleWorkerType | 类型 | type MemoryLifecycleWorkerType = 'retention' | 'decay' | 'consolidation' | 'deletion' | 'reindex' | 'provider_reconciliation' | Memory Lifecycle Worker Type 公共类型别名;完整类型表达式见声明。 |
InMemoryMemoryLifecycleTaskStore
In Memory Memory Lifecycle Task Store 类,共公开 7 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { InMemoryMemoryLifecycleTaskStore } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class InMemoryMemoryLifecycleTaskStore implements MemoryLifecycleTaskStore {
enqueue(task: MemoryLifecycleTask): Promise<void>;
lease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]>;
renew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean>;
complete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean>;
fail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean>;
list(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
complete | 方法 | complete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
constructor | 构造函数 | (): InMemoryMemoryLifecycleTaskStore | 创建该类的实例。 |
enqueue | 方法 | enqueue(task: MemoryLifecycleTask): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
fail | 方法 | fail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
lease | 方法 | lease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]> | 公开方法;参数与返回类型以签名列为准。 |
list | 方法 | list(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]> | 公开方法;参数与返回类型以签名列为准。 |
renew | 方法 | renew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
LeasedMemoryLifecycleWorker
Leased Memory Lifecycle Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { LeasedMemoryLifecycleWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class LeasedMemoryLifecycleWorker {
constructor(options: MemoryLifecycleWorkerOptions);
runOnce(): Promise<MemoryLifecycleWorkerRunResult>;
start(): void;
stop(): void;
drain(): Promise<void>;
stopAndDrain(): Promise<void>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: MemoryLifecycleWorkerOptions): LeasedMemoryLifecycleWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryConsolidationWorker
Memory Consolidation Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MemoryConsolidationWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class MemoryConsolidationWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryConsolidationWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryDecayWorker
Memory Decay Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MemoryDecayWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class MemoryDecayWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryDecayWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryDeletionWorker
Memory Deletion Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MemoryDeletionWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class MemoryDeletionWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryDeletionWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryReindexWorker
Memory Reindex Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MemoryReindexWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class MemoryReindexWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryReindexWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryRetentionWorker
Memory Retention Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { MemoryRetentionWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class MemoryRetentionWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): MemoryRetentionWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
ProviderReconciliationWorker
Provider Reconciliation Worker 类,共公开 6 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { ProviderReconciliationWorker } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export declare class ProviderReconciliationWorker extends LeasedMemoryLifecycleWorker {
constructor(options: Omit<MemoryLifecycleWorkerOptions, 'type'>);
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: Omit<MemoryLifecycleWorkerOptions, "type">): ProviderReconciliationWorker | 创建该类的实例。 |
drain | 方法 | drain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
runOnce | 方法 | runOnce(): Promise<MemoryLifecycleWorkerRunResult> | 公开方法;参数与返回类型以签名列为准。 |
start | 方法 | start(): void | 公开方法;参数与返回类型以签名列为准。 |
stop | 方法 | stop(): void | 公开方法;参数与返回类型以签名列为准。 |
stopAndDrain | 方法 | stopAndDrain(): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
MemoryLifecycleTask
Memory Lifecycle Task 接口,共包含 15 个公开字段或方法。
- 种类: 接口
- 导入:
import type { MemoryLifecycleTask } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export interface MemoryLifecycleTask<TPayload = unknown> {
id: string;
operationId: string;
type: MemoryLifecycleWorkerType;
scopeHash: string;
payload: TPayload;
state: 'pending' | 'processing' | 'completed' | 'failed' | 'dead_letter';
attempts: number;
availableAt: string;
leaseOwner?: string;
leaseToken?: string;
leaseExpiresAt?: string;
fencingToken?: number;
lastError?: NormalizedMemoryError;
createdAt: string;
updatedAt: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
attempts | 属性 | attempts: number | 公开属性;类型、只读和可选状态以签名列为准。 |
availableAt | 属性 | availableAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
createdAt | 属性 | createdAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
fencingToken | 属性 | fencingToken?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
lastError | 属性 | lastError?: NormalizedMemoryError | 公开属性;类型、只读和可选状态以签名列为准。 |
leaseExpiresAt | 属性 | leaseExpiresAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
leaseOwner | 属性 | leaseOwner?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
leaseToken | 属性 | leaseToken?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
payload | 属性 | payload: TPayload | 公开属性;类型、只读和可选状态以签名列为准。 |
scopeHash | 属性 | scopeHash: string | 公开属性;类型、只读和可选状态以签名列为准。 |
state | 属性 | state: "completed" | "failed" | "processing" | "pending" | "dead_letter" | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: MemoryLifecycleWorkerType | 公开属性;类型、只读和可选状态以签名列为准。 |
updatedAt | 属性 | updatedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
MemoryLifecycleTaskStore
Memory Lifecycle Task Store 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { MemoryLifecycleTaskStore } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export interface MemoryLifecycleTaskStore {
enqueue(task: MemoryLifecycleTask): Promise<void>;
lease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]>;
renew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean>;
complete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean>;
fail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean>;
list(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
complete | 方法 | complete(taskId: string, ownerId: string, leaseToken: string, now: string): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
enqueue | 方法 | enqueue(task: MemoryLifecycleTask): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
fail | 方法 | fail(taskId: string, ownerId: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter: boolean): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
lease | 方法 | lease(type: MemoryLifecycleWorkerType, ownerId: string, now: string, leaseUntil: string, limit: number): Promise<MemoryLifecycleTask[]> | 公开方法;参数与返回类型以签名列为准。 |
list | 方法 | list(type?: MemoryLifecycleWorkerType): Promise<MemoryLifecycleTask[]> | 公开方法;参数与返回类型以签名列为准。 |
renew | 方法 | renew(taskId: string, ownerId: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean> | 公开方法;参数与返回类型以签名列为准。 |
MemoryLifecycleWorkerEvent
Memory Lifecycle Worker Event 接口,共包含 5 个公开字段或方法。
- 种类: 接口
- 导入:
import type { MemoryLifecycleWorkerEvent } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export interface MemoryLifecycleWorkerEvent {
type: 'memory.worker.started' | 'memory.worker.stopped' | 'memory.worker.failed' | 'memory.worker.dead_lettered';
workerType: MemoryLifecycleWorkerType;
taskId?: string;
operationId?: string;
error?: NormalizedMemoryError;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
error | 属性 | error?: NormalizedMemoryError | 公开属性;类型、只读和可选状态以签名列为准。 |
operationId | 属性 | operationId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
taskId | 属性 | taskId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: "memory.worker.started" | "memory.worker.stopped" | "memory.worker.failed" | "memory.worker.dead_lettered" | 公开属性;类型、只读和可选状态以签名列为准。 |
workerType | 属性 | workerType: MemoryLifecycleWorkerType | 公开属性;类型、只读和可选状态以签名列为准。 |
MemoryLifecycleWorkerOptions
Memory Lifecycle Worker Options 接口,共包含 12 个公开字段或方法。
- 种类: 接口
- 导入:
import type { MemoryLifecycleWorkerOptions } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export interface MemoryLifecycleWorkerOptions {
type: MemoryLifecycleWorkerType;
ownerId: string;
store: MemoryLifecycleTaskStore;
handler: MemoryLifecycleTaskHandler;
batchSize?: number;
leaseMs?: number;
renewalMs?: number;
retryDelayMs?: number;
maxAttempts?: number;
pollIntervalMs?: number;
now?: () => Date;
onEvent?: (event: MemoryLifecycleWorkerEvent) => void | Promise<void>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
batchSize | 属性 | batchSize?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
handler | 方法 | handler(task: MemoryLifecycleTask, signal: AbortSignal): Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
leaseMs | 属性 | leaseMs?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
maxAttempts | 属性 | maxAttempts?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
now | 方法 | now?(): Date | 公开方法;参数与返回类型以签名列为准。 |
onEvent | 方法 | onEvent?(event: MemoryLifecycleWorkerEvent): void | Promise<void> | 公开方法;参数与返回类型以签名列为准。 |
ownerId | 属性 | ownerId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
pollIntervalMs | 属性 | pollIntervalMs?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
renewalMs | 属性 | renewalMs?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
retryDelayMs | 属性 | retryDelayMs?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
store | 属性 | store: MemoryLifecycleTaskStore | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: MemoryLifecycleWorkerType | 公开属性;类型、只读和可选状态以签名列为准。 |
MemoryLifecycleWorkerRunResult
Memory Lifecycle Worker Run Result 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { MemoryLifecycleWorkerRunResult } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export interface MemoryLifecycleWorkerRunResult {
leased: number;
completed: number;
failed: number;
deadLettered: number;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
completed | 属性 | completed: number | 公开属性;类型、只读和可选状态以签名列为准。 |
deadLettered | 属性 | deadLettered: number | 公开属性;类型、只读和可选状态以签名列为准。 |
failed | 属性 | failed: number | 公开属性;类型、只读和可选状态以签名列为准。 |
leased | 属性 | leased: number | 公开属性;类型、只读和可选状态以签名列为准。 |
MemoryLifecycleTaskHandler
Memory Lifecycle Task Handler 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { MemoryLifecycleTaskHandler } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export type MemoryLifecycleTaskHandler = (task: MemoryLifecycleTask, signal: AbortSignal) => Promise<void>;MemoryLifecycleWorkerType
Memory Lifecycle Worker Type 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { MemoryLifecycleWorkerType } from '@codesoul-co/hypha-memory'; - 源码模块:
lifecycle-workers
声明
export type MemoryLifecycleWorkerType = 'retention' | 'decay' | 'consolidation' | 'deletion' | 'reindex' | 'provider_reconciliation';