# IMQServiceOptions.drainTimeout property · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.imqserviceoptions.draintimeout/
Published: 2026-08-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.9.0 — generated reference, not hand-written

Milliseconds a drain waits for in-flight requests before giving up on them and exiting anyway. Ignored unless [IMQServiceOptions.drain](https://imqueue.org/api/rpc/latest/rpc.imqserviceoptions.drain/) is on.

**Signature:**

```typescript
drainTimeout?: number;
```

## Default Value

the `IMQ_DRAIN_TIMEOUT` environment variable, itself defaulting to [DEFAULT\_IMQ\_DRAIN\_TIMEOUT](https://imqueue.org/api/rpc/latest/rpc.default_imq_drain_timeout/) (4000)

## Remarks

The wait is always bounded: whatever has not finished by then is abandoned, logged, and the process exits `0` regardless.

