Uneventful
    Preparing search index...

    Completion<T>

    Interface for completing a Future or Task with a return value or error.

    interface Completion<T> {
        return(val: T): this;
        throw(err: any): this;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Producing Results

    Producing Results

    • End the task/future with a return value, passing a ValueResult to cleanup callbacks and listeners. (Throws an error if the task is already ended or is currently cleaning up.) Provides the same execution and ordering guarantees as .end().

      Parameters

      • val: T

      Returns this

    • End the task/future with a thrown error, passing an ErrorResult to cleanup callbacks and listeners. (Throws an error if the task is already ended or is currently cleaning up.) Provides the same execution and ordering guarantees as .end().

      Note: since this immediately ends the task with an error, it should only be called when the work of the task as a whole is no longer able to continue. If you want to notify a task about an error in a different task, you may want to use .asyncThrow() instead.

      Parameters

      • err: any

      Returns this