---
title: AsyncThrowingStream.Continuation
framework: swift
role: symbol
role_heading: Structure
path: swift/asyncthrowingstream/continuation
---

# AsyncThrowingStream.Continuation

A mechanism to interface between synchronous code and an asynchronous stream.

## Declaration

```swift
struct Continuation
```

## Overview

Overview The closure you provide to the AsyncThrowingStream in init(_:bufferingPolicy:_:) receives an instance of this type when invoked. Use this continuation to provide elements to the stream by calling one of the yield methods, then terminate the stream normally by calling the finish() method. You can also use the continuation’s finish(throwing:) method to terminate the stream by throwing an error. note: Unlike other continuations in Swift, AsyncThrowingStream.Continuation supports escaping.

## Topics

### Producing Elements

- [yield(_:)](swift/asyncthrowingstream/continuation/yield(_:).md)
- [yield(with:)](swift/asyncthrowingstream/continuation/yield(with:).md)
- [yield()](swift/asyncthrowingstream/continuation/yield().md)
- [AsyncThrowingStream.Continuation.YieldResult](swift/asyncthrowingstream/continuation/yieldresult.md)

### Finishing the Stream

- [finish(throwing:)](swift/asyncthrowingstream/continuation/finish(throwing:).md)

### Handling Termination

- [onTermination](swift/asyncthrowingstream/continuation/ontermination.md)
- [AsyncThrowingStream.Continuation.Termination](swift/asyncthrowingstream/continuation/termination.md)

### Enumerations

- [AsyncThrowingStream.Continuation.BufferingPolicy](swift/asyncthrowingstream/continuation/bufferingpolicy.md)

### Default Implementations

- [Equatable Implementations](swift/asyncthrowingstream/continuation/equatable-implementations.md)
- [Hashable Implementations](swift/asyncthrowingstream/continuation/hashable-implementations.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating a Continuation-Based Stream

- [init(_:bufferingPolicy:_:)](swift/asyncthrowingstream/init(_:bufferingpolicy:_:).md)
- [AsyncThrowingStream.Continuation.BufferingPolicy](swift/asyncthrowingstream/continuation/bufferingpolicy.md)
