<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/BlockchainSync/Updates/AsyncIterator",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel14BlockchainSyncV7UpdatesV13AsyncIteratorV"
  },
  "title" : "BlockchainSync.Updates.AsyncIterator"
}
-->

# BlockchainSync.Updates.AsyncIterator

Single-consumer iterator over a running sync.

```
struct AsyncIterator
```

## Overview

Owns the `AsyncStream` backing the sync and the `Task` that
drives the producer. Cleanup (`Task.cancel()` +
[`interrupt()`](/documentation/BitcoinKernel/Context/interrupt())) fires via `AsyncStream.onTermination`
when the iterator goes out of scope or the stream finishes.