private let queue = AsyncQueue(name: "PoppinsSyncQueue", maxOperations: 10)

class Async {
    private var _done: (() -> ())?

    class func map<U, T>(u: [U], f: U -> T) -> Async {
        var proc = Async()

        u.map { x in
            queue.addOperationWithBlock { _ = f(x) }
        }

        queue.finally { _ = proc._done?() }

        return proc
    }

    func done(f: () -> ()) {
        _done = f
    }
}

class Async {
    private var _done: (() -> ())?

    class func map<U, T>(u: [U], f: U -> T) -> Async {
        var proc = Async()
        let queue = AsyncQueue(name: "PoppinsSyncQueue", maxOperations: 10)

        u.map { x in
            queue.addOperationWithBlock { _ = f(x) }
        }

        queue.finally { _ = proc._done?() }

        return proc
    }

    func done(f: () -> ()) {
        _done = f
    }
}

--- 
+++ 
@@ -1,9 +1,10 @@
+private let queue = AsyncQueue(name: "PoppinsSyncQueue", maxOperations: 10)
+
 class Async {
     private var _done: (() -> ())?
 
     class func map<U, T>(u: [U], f: U -> T) -> Async {
         var proc = Async()
-        let queue = AsyncQueue(name: "PoppinsSyncQueue", maxOperations: 10)
 
         u.map { x in
             queue.addOperationWithBlock { _ = f(x) }
Move queue to global constant

This needs to be a global constant so that it isn't affected by memory
management.
