Scheduled

public struct Scheduled<T>

Returned once a task was scheduled on the EventLoop for later execution.

A Scheduled allows the user to either cancel() the execution of the scheduled task (if possible) or obtain a reference to the EventLoopFuture that will be notified once the execution is complete.

  • Undocumented

    Declaration

    Swift

    public init(promise: EventLoopPromise<T>, cancellationTask: @escaping () -> Void)
  • Try to cancel the execution of the scheduled task.

    Whether this is successful depends on whether the execution of the task already begun. This means that cancellation is not guaranteed.

    Declaration

    Swift

    public func cancel()
  • Returns the EventLoopFuture which will be notified once the execution of the scheduled task completes.

    Declaration

    Swift

    public var futureResult: EventLoopFuture<T> { get }