 
 import CLibUv
 
-private typealias WorkQueueTask = () -> ()
-
 private func work_cb(req: UnsafeMutablePointer<uv_work_t>?) {
     guard let req = req else {
         return
     }
-    let ctx: QueueWorkerContext = releaseVoidPointer(req.pointee.data)!
+    let ctx: QueueWorkContext = releaseVoidPointer(req.pointee.data)!
     ctx.workCB()
     req.pointee.data = retainedVoidPointer(ctx)
 }

    }
}

public class QueueWorkerWrap {
    public init(loop: Loop = Loop.defaultLoop, workCB: () -> (), afterWorkCB: () -> ()) {
        let req = UnsafeMutablePointer<uv_work_t>(allocatingCapacity: sizeof(uv_work_t.self))
        
        let context = QueueWorkerContext(workCB: workCB, afterWorkCB: afterWorkCB)
        
        req.pointee.data = retainedVoidPointer(context)
        uv_queue_work(loop.loopPtr, req, work_cb, after_work_cb)
    }
}

        dealloc(req)
    }
    
    let ctx: QueueWorkContext = releaseVoidPointer(req.pointee.data)!
    ctx.afterWorkCB()
}

private struct QueueWorkContext {
    let workCB: () -> ()
    let afterWorkCB: () -> ()
    
