         }
     }
     
-    func onFailure(callback: NSError -> ()) {
+    func onFailure(callback: FailureCallback) {
         self.onFailure(context: self.defaultCallbackExecutionContext, callback)
     }
     
-    func onFailure(context c: ExecutionContext, callback: NSError -> ()) {
+    func onFailure(context c: ExecutionContext, callback: FailureCallback) {
         self.onComplete(context: c) { result in
             if result.error {
                 callback(result.error!)

    typealias CallbackInternal = (future: Future<T>) -> ()
    typealias CompletionCallback = (result: TaskResult<T>) -> ()
    typealias SuccessCallback = (T) -> ()
    typealias FailureCallbacl = (NSError) -> ()
    
    let q = Queue()
    

        }
    }
    
    func onSuccess(callback: SuccessCallback) {
        self.onSuccess(context: self.defaultCallbackExecutionContext, callback)
    }
    
    func onSuccess(context c: ExecutionContext, callback: SuccessCallback) {
        self.onComplete(context: c) { result in
            if !result.error {
                callback(result.value!)
