• Effekt Logo Effekt Library
    • io/promise
      • State
        • Pending
        • Resolved
      • Promise
      • promise
        • make
      • promise
      • await
      • resolve
    • io/promise
    • Jump to source: libraries/common/io/promise.effekt
      Example usage: examples/stdlib/io/promise
      • State [T]
        • Pending (signals: List[Signal[T, Unit]])
        • Resolved (value: T)
      • Promise [T]
      • promise
        • make [T]: Promise[T] / {}
        • Creates a pending promise that must be resolved exactly once
          and can be awaited multiple times.
      • promise [T] (task: => T at {io,async,global}): Promise[T] / {}
      • Spawns a task and immediately returns a promise that upon completion
        of the task will resolve to its result.
      • await [T] (promise: Promise[T]): T / {}
      • Awaits and blocks until the given promise is resolved.
      • resolve [T] (promise: Promise[T], value: T): Unit / {}
      • Resolves the given promise, unblocking all awaiting tasks.