SwiftclassJetCore

class JetCore.LazyPromise

Structure

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

inherits{}

Members 13

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

    init(on: any JetCore.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 JetCore.TaskScheduler, _: @escaping (_: A) throws -> A1) -> JetCore.LazyPromise<A1>
    final func join<A1>(with: A1) -> JetCore.LazyPromise<(A, A1.Value)> where A1: JetCore.Future
    final func then(perform: @escaping (_: A) -> (), orCatchError: @escaping (_: any Swift.Error) -> (), on: any JetCore.TaskScheduler)
    final func then() async throws -> A
    final func start() -> JetCore.Promise<A>
    final func flatMap<A1>(on: any JetCore.TaskScheduler, _: @escaping (_: A) -> A1) -> JetCore.LazyPromise<A1.Value> where A1: JetCore.Future

    deinit
}