Container pattern for managing multiple Future operations in KOS models.

Provides comprehensive Future management capabilities for models that handle multiple concurrent long-running operations with centralized lifecycle management.

Example: Basic Future Container

@kosModel("device-operations-model")
export class DeviceOperationsModel implements FutureContainer {
futureHandler: FutureAwareContainer;

constructor(modelId: string, options: any, context: KosCreationContext) {
this.id = modelId;
this.futureHandler = new FutureHandler(this);
}

onFutureUpdate(future: IFutureModel): void {
// Handle progress updates from any managed Future
console.log(`Operation ${future.id}: ${future.progress}%`);
}
}
interface FutureContainer<T> {}

Type Parameters

  • T extends {} = Record<string, unknown>

Hierarchy (view full)