<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/AsyncStream/Continuation/BufferingPolicy/bufferingOldest(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:ScS12ContinuationV15BufferingPolicyO15bufferingOldestyADyx__GSicAFmlF"
  },
  "title" : "AsyncStream.Continuation.BufferingPolicy.bufferingOldest(_:)"
}
-->

# AsyncStream.Continuation.BufferingPolicy.bufferingOldest(_:)

When the buffer is full, discard the newly received element.

```
case bufferingOldest(Int)
```

## Discussion

This strategy enforces keeping at most the specified number of oldest values.

> Note: If the specified number is zero or negative, no elements are buffered.
> In that case, an iterator receives an element only if it is already awaiting a value when the continuation yields.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)