SuspensionResult is the return type of coroutine calls.

Static variables

@:value(new SuspensionResult<Any>(Pending))staticfinalread onlysuspended:SuspensionResult<Any> = new SuspensionResult<Any>(Pending)

Static methods

staticwithError<T>(error:Exception):SuspensionResult<Any>

Creates a new SuspensionResult instance with error error.

staticwithResult<T>(result:T):SuspensionResult<T>

Creates a new SuspensionResult instance with result result.

Constructor

new(state:SuspensionState)

Creates a new instance with the given state.

Variables

error:Null<Exception>

The error value of the coroutine, is any.

result:Null<T>

The result value of the coroutine, if any.

state:SuspensionState

The current state of the suspension.

Methods

resolveTo(cont:IContinuation<T>):Void

If this result is Returned or Thrown, resumes cont with the corresponding result or error. If this result is Pending, this is a no-op.