---
title: "makeStream(of:throwing:bufferingPolicy:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/asyncthrowingstream/makestream(of:throwing:bufferingpolicy:)"
---

# makeStream(of:throwing:bufferingPolicy:)

Initializes a new AsyncThrowingStream and an AsyncThrowingStream.Continuation.

## Declaration

```swift
@backDeployed(before: macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0)
static func makeStream(of elementType: Element.Type = Element.self, throwing failureType: Failure.Type = Failure.self, bufferingPolicy limit: AsyncThrowingStream<Element, Failure>.Continuation.BufferingPolicy = .unbounded) -> (stream: AsyncThrowingStream<Element, Failure>, continuation: AsyncThrowingStream<Element, Failure>.Continuation) where Failure == any Error
```

## Parameters

- `elementType`: The element type of the stream.
- `failureType`: The failure type of the stream.
- `limit`: The buffering policy that the stream should use.

## Return Value

Return Value A tuple containing the stream and its continuation. The continuation should be passed to the producer while the stream should be passed to the consumer.
