             }
         }
         
-        for requestId in allList {
-            if let engine = mutex.synchronized({ self.requestUseEngines[requestId] }) {
-                
-                //Cancel in queue
-                if let queue = engine.queueForRequest {
-                    queue.async {
-                        engine.cancelRequest(requestId: requestId)
-                    }
-                } else {
-                    //Or in current thread
-                    engine.cancelRequest(requestId: requestId)
-                }
-                
-            }
-        }
+        internalCancelRequests(ids: allList)
+    }
+    
+    /**
+     List all requestKey in current queue for Type
+     
+     - Parameter type: The requestKey.Type to find in the current queue.
+     - Returns: list requestKeys for Type
+     */
+    public func allRequestKeys<T: Hashable>(type: T.Type = T.self) -> [T] {
+        mutex.lock()
+        defer { mutex.unlock() }
+        
+        var list = [T]()
+        
+        for requestKey in requestList.keys {
+            if let key = requestKey.base as? T {
+                list.append(key)
+            }
+        }
+        
+        return list
     }
     
     

     */
    public func cancelRequest(requestKey:AnyHashable?) {
        if let list = internalListRequest(requestKey: requestKey) {
            for requestId in list {
                if let engine = mutex.synchronized({ self.requestUseEngines[requestId] }) {
                    
                    //Cancel in queue
                    if let queue = engine.queueForRequest {
                        queue.async {
                            engine.cancelRequest(requestId: requestId)
                        }
                    } else {
                        //Or in current thread
                        engine.cancelRequest(requestId: requestId)
                    }
                    
                }
            }
        }
    }
    
    /// Cancel all requests in current queue.
    ///
    /// Signal cancel send to engine, but real canceled implementation in engine.
    public func cancelAllRequests() {
        var allList = Set<UInt64>()
        

        return requestList[key]
    }
    
    private func internalListRequest<T: Hashable>(requestKeyType:T.Type, onlyFirst: Bool) -> Set<UInt64>? {
        mutex.lock()
        defer { mutex.unlock() }
        
        var ids = Set<UInt64>()
        
        for (requestKey, requestIds) in requestList {
            if requestKey.base is T {
                if onlyFirst {
                    return requestIds
                } else {
                    ids.formUnion(requestIds)
                }
            }
        }
        
        return ids.isEmpty ? nil : ids
    }
    
    private func internalCancelRequests(ids: Set<UInt64>) {
        for requestId in ids {
            if let engine = mutex.synchronized({ self.requestUseEngines[requestId] }) {
                
                //Cancel in queue
                if let queue = engine.queueForRequest {
                    queue.async {
                        engine.cancelRequest(requestId: requestId)
                    }
                } else {
                    //Or in current thread
                    engine.cancelRequest(requestId: requestId)
                }
            }
        }
    }
    
    private struct EmptyKey: Hashable {
        var hashValue: Int { return 0 }
