# Handling long streams of data, or handling header and body efficiently?

**URL:** <https://forums.swift.org/t/handling-long-streams-of-data-or-handling-header-and-body-efficiently/41353>\
**Category:** SwiftNIO\
**Tags:** swift-nio\
**Created:** [October 21, 2020, 3:57pm UTC](https://forums.swift.org/t/handling-long-streams-of-data-or-handling-header-and-body-efficiently/41353 "2020-10-21T15:57:43Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![johannesweiss](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johannesweiss/32/38183_2.png) [@johannesweiss](https://forums.swift.org/u/johannesweiss)\
**Post date:** [October 22, 2020, 2:53pm UTC](https://forums.swift.org/t/handling-long-streams-of-data-or-handling-header-and-body-efficiently/41353/6 "2020-10-22T14:53:08Z")

</div>

@lukasa already answered all the questions here but for others reading this, I thought it may be worth linking some other, very similar information available from [this thread](https://forums.swift.org/t/how-to-use-nonblockingfileio-for-repeated-writes/36206/2) (and [some images](https://forums.swift.org/t/how-to-use-nonblockingfileio-for-repeated-writes/36206/8) which may help) and [that example](https://github.com/apple/swift-nio-examples/tree/main/backpressure-file-io-channel) as well. I thought maybe reading similar thoughts explained in slightly. They discuss exerting backpressure from the network (HTTP upload) to disk (saving the uploaded file).

---

_[View the full topic](https://forums.swift.org/t/handling-long-streams-of-data-or-handling-header-and-body-efficiently/41353)._
