                 context.operations.push(queuedOperation)
             }
         }
+        try Task.checkCancellation()
+        return value
     }
     
     private func dequeue<Operation>(

        #if DEBUG
        log?("Queue \(function) for peripheral \(peripheral)")
        #endif
        return try await withThrowingContinuation(for: peripheral, function: function) { continuation in
            let queuedOperation = QueuedOperation(operation: operation(continuation))
            self.async { [unowned self] in
                self.stopScan() // stop scanning

        filter: (DarwinCentral.Operation) -> (Operation?)
    ) where Operation: DarwinCentralOperation {
        #if DEBUG
        log?("Dequeue \(function) for peripheral \(peripheral)")
        #endif
        let context = self.continuation(for: peripheral)
        context.operations.popFirst(where: { filter($0.operation) }) { (queuedOperation, operation) in
