Name

FutureModel

Version

1.0.0

Author

Matthew Holman maholman@coca-cola.com

Represents a future.

Hierarchy (view full)

Implements

Accessors

Constructors - Constructor

Methods - Action

Accessors

  • get status(): FutureEndState | "IN_PROGRESS" | "NOT_ACTIVE"
  • Gets the current status of the future operation.

    Returns FutureEndState | "IN_PROGRESS" | "NOT_ACTIVE"

    Status string: "NOT_ACTIVE", "IN_PROGRESS", "Success", or "Fail"

    Example: Monitor Status

    if (future.status === "IN_PROGRESS") {
    console.log(`Operation running: ${future.progress}% complete`);
    } else if (future.status === "Success") {
    console.log("Operation completed successfully!");
    }
  • get timeRemaining(): string
  • Gets human-readable time remaining for the operation.

    Returns string

    Formatted time string (e.g., "5 minutes", "30 seconds") or empty string if unknown

    Example: Display Time Remaining

    const timeLeft = future.timeRemaining;
    if (timeLeft) {
    console.log(`${timeLeft} remaining`);
    }

Constructors - Constructor

  • Parameters

    • modelId: string

      the unique modelId for this Future

    • options: IFutureModelOptions<Record<string, unknown>>

      any options that should be merged into the Future

    • context: KosCreationContext

    Returns FutureModel

    Params

    options.id - the unique id of the Future

    Params

    options.name - the name of the Future

Methods - Action

  • Returns Promise<void>

    Remark

    Cancels the current future.

    If a service was passed in as part of the options in the constructor then it will be used. Otherwise the default services will be invoked.

    See

    cancelFutureService