---
title: "ReadableStreamDefaultController | Grafana k6 documentation"
description: "ReadableStreamDefaultController allows to control a ReadableStream's state and internal queue."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# ReadableStreamDefaultController

The `ReadableStreamDefaultController` type allows you to control a `ReadableStream`’s state and internal queue.

## Methods

Expand table

| Name                                                                                                            | Description                                          |
|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| [close()](/docs/k6/next/javascript-api/k6-experimental/streams/readablestreamdefaultcontroller/close/)          | Closes the associated stream.                        |
| [enqueue(chunk)](/docs/k6/next/javascript-api/k6-experimental/streams/readablestreamdefaultcontroller/enqueue/) | Enqueues a chunk of data into the associated stream. |
| [error(reason)](/docs/k6/next/javascript-api/k6-experimental/streams/readablestreamdefaultcontroller/error/)    | Causes the stream to become errored.                 |
