     @inline(__always)
     private func async(_ body: @escaping () -> ()) {
         queue.async(execute: body)
+    }
+    
+    private func queue<T>(
+        for peripheral: Peripheral,
+        _ task: @escaping () async throws -> (T)
+    ) async throws -> T {
+        let priority = Task.currentPriority
+        let newTask = queue.sync { [unowned self] in
+            let previousTask = self.tasks[peripheral]
+            let newTask = Task(priority: priority) {
+                _ = await previousTask?.result // wait for previous task
+                return try await task() // actually execute task
+            }
+            // type erased task
+            self.tasks[peripheral] = Task(priority: priority) {
+                _ = await newTask.result
+            }
+            return newTask
+        }
+        return try await newTask.value
     }
     
     private func continuation(for peripheral: Peripheral) -> PeripheralContinuationContext {

        _ services: Set<BluetoothUUID> = [],
        for service: DarwinCentral.Service
    ) async throws -> [DarwinCentral.Service] {
        return try await withThrowingContinuation(for: service.peripheral) { [weak self] continuation in
            guard let self = self else { return }
            self.async {
                self.stopScan()
                let context = self.continuation(for: service.peripheral)
                context.operation?.cancel()
                context.operation = nil
                let operation = Operation.DiscoverIncludedServices(
                    service: service,
                    services: services,
                    continuation: continuation
                )
                if self.execute(operation) {
                    context.operation = .discoverIncludedServices(operation)
                }
            }
        }

            if let error = error {
                operation.continuation.resume(throwing: error)
            } else {
                assert(characteristicObject.isNotifying == operation.isEnabled)
                operation.continuation.resume()
            }
        }
