Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ const streamContext = createResumableStreamContext({
});
```

### Usage with custom TTL

You can customize the time-to-live for Redis keys by passing a `ttl` parameter in seconds:

```typescript
import { createResumableStreamContext } from "resumable-stream";
import { after } from "next/server";

const streamContext = createResumableStreamContext({
waitUntil: after,
ttl: 3600, // 1 hour instead of the default 24 hours
// Optionally pass in your own Redis publisher and subscriber
});
```

## Type Docs

[Type Docs](https://github.com/vercel/resumable-stream/blob/main/docs/README.md)
Expand Down
8 changes: 8 additions & 0 deletions docs/interfaces/CreateResumableStreamContextOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ A pubsub subscriber. Designed to be compatible with clients from the `redis` pac

***

### ttl?

> `optional` **ttl**: `number`

Time to live in seconds for Redis keys. Defaults to 24 hours (86400 seconds).

***

### waitUntil()

> **waitUntil**: (`promise`) => `void`
Expand Down
Loading