SwiftclassJetEngine

class JetEngine.LazyPromise

Structure

What a query’s scopes step through. Every node here can be matched — see the syntax.

inherits{}

Members 14

  1. deinitdeinit
  2. fieldvar state: JetEngine.LazyPromise<A>.State
  3. fieldlet stateLock: os.OSAllocatedUnfairLock<()>
  4. funcflatMap<A where A1: JetEngine.Future>(on: JetEngine.TaskScheduler, _: (A) -> A1) -> JetEngine.LazyPromise<A1.Value>
  5. funcjoin<A where A1: JetEngine.Future>(with: A1) -> JetEngine.LazyPromise<(A, A1.Value)>
  6. funcmap<A>(on: JetEngine.TaskScheduler, _: (A) throws -> A1) -> JetEngine.LazyPromise<A1>
  7. funcstart() -> JetEngine.Promise<A>
  8. functhen(perform: (A) -> (), orCatchError: (Error) -> (), on: JetEngine.TaskScheduler) -> ()
  9. functhen() async throws -> A
  10. initJetEngine.LazyPromise.__allocating_init(on: JetEngine.TaskScheduler, perform: ((A) -> (), (Error) -> ()) -> ()) -> JetEngine.LazyPromise<A>
  11. initJetEngine.LazyPromise.__allocating_init(task: @Sendable () async throws -> A) -> JetEngine.LazyPromise<A>
  12. initJetEngine.LazyPromise<A where A: AnyObject>.init(AMSLazyPromise<A>) -> JetEngine.LazyPromise<A>
  13. typealiastypealias Value = A
  14. varfinal var hasStarted: Bool { get }
class LazyPromise<A> {
    enum State {
        case pending(any JetEngine.TaskScheduler, @Sendable (@escaping (_: A) -> (), @escaping (_: any Swift.Error) -> ()) -> ())
        case started(JetEngine.Promise<A>)
    }
    struct TaskOutcome {
        let resolve: (_: A) -> ()
        let reject: (_: any Swift.Error) -> ()

        init(_: @escaping (_: A) -> (), _: @escaping (_: any Swift.Error) -> ())
    }
    let stateLock: os.OSAllocatedUnfairLock<()>
    var state: JetEngine.LazyPromise<A>.State

    init(on: any JetEngine.TaskScheduler, perform: @escaping (@escaping (_: A) -> (), @escaping (_: any Swift.Error) -> ()) -> ())

    init(task: @escaping @Sendable () async throws -> A)

    final var hasStarted: Swift.Bool {
        get
    }

    final func map<A1>(on: any JetEngine.TaskScheduler, _: @escaping (_: A) throws -> A1) -> JetEngine.LazyPromise<A1>
    final func join<A1>(with: A1) -> JetEngine.LazyPromise<(A, A1.Value)> where A1: JetEngine.Future
    final func then(perform: @escaping (_: A) -> (), orCatchError: @escaping (_: any Swift.Error) -> (), on: any JetEngine.TaskScheduler)
    final func then() async throws -> A
    final func start() -> JetEngine.Promise<A>
    final func flatMap<A1>(on: any JetEngine.TaskScheduler, _: @escaping (_: A) -> A1) -> JetEngine.LazyPromise<A1.Value> where A1: JetEngine.Future

    deinit
}