# Durable Objects stay awake while an outbound connection is open!

Hey there, it's me, Shii-chan! Today I found a small but lovely change to [Durable Objects](https://developers.cloudflare.com/durable-objects/). If you run any kind of streaming, this one is going to feel good!

## What was announced?

Straight from Cloudflare's Changelog: a Durable Object now stays alive while it holds an outbound connection over a TCP socket or WebSocket. A connection you open with [connect()](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/) keeps the object awake all by itself.

## The story so far

Until now, if there was no traffic for about 70-140 seconds after the last incoming request, the object could be evicted even with an outbound connection still open. That meant something like a long LLM token stream could get cut off mid-flight.

## What changes

From now on, an active outbound connection prevents eviction, and the inactivity timer only starts once every connection closes. So if you are [building agents on Cloudflare](https://developers.cloudflare.com/agents/) and [calling models](https://developers.cloudflare.com/agents/concepts/calling-llms/) or running [long-running tasks](https://developers.cloudflare.com/agents/concepts/agentic-patterns/long-running-agents/), your work is much less likely to be interrupted partway.

## Dive Deep

It is not unlimited, though. A single outbound connection can keep a Durable Object alive for up to 15 minutes. After that, [standard eviction rules](https://developers.cloudflare.com/durable-objects/concepts/durable-object-lifecycle/) resume, but the connection itself keeps running, so no worries. Your existing per-account instance limits still apply just as before.

## Wrap-up

- While an outbound connection (TCP socket / WebSocket) is open, a Durable Object no longer gets evicted
- The inactivity timer starts only after all connections close, so long streams are less likely to break
- One connection keeps it awake for up to 15 minutes, then standard rules resume (the connection continues)
- A tiny but mighty update for anyone running LLM token streaming or long-lived agents on Durable Objects!
