Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Hydra_Internal_2.swift
public class Promise<Value> {
internal var state: State<Value> = .pending
internal let stateQueue = DispatchQueue(label: "com.mokasw.promise")
private var body: Body?
private(set) var context: Context = Context.custom(queue: DispatchQueue.global(qos: .background))
private var observers: [Observer<Value>] = []
internal var bodyCalled: Bool = false
public init(in context: Context? = nil, _ body: @escaping Body) {
self.state = .pending
self.context = context ?? Context.custom(queue: DispatchQueue.global(qos: .background))
self.body = body
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment