Swiftpack.co - AppAccount/AsyncStream as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AppAccount.
AppAccount/AsyncStream 3.0.0
Concurrency safe wrapper for (NS)Stream class cluster using Swift 5.5 Async/Await and Actors.
⭐️ 3
🕓 3 weeks ago
iOS macOS
.package(url: "https://github.com/AppAccount/AsyncStream.git", from: "3.0.0")

AsyncStream

Concurrency safe wrapper for (NS)Stream class cluster using Swift 5.5 Async/Await and Actors. InputStreamActor for reading from a stream oriented source and OutputStreamActor for writing to a stream oriented sink.

Use setWriteDataStream(_ writeDataStream: AsyncStream<Data>?) async to provide an AsyncStream of bytes to be delivered to the underlying OutputStream. Repeated calls to this method will block until the prior stream (if any) has finished.

Stream events are processed on RunLoop.current. As a client of this package, you are responsible for ensuring the RunLoop is actually running, whether using the main thread runloop or explicitly running a background thread runloop.

GitHub

link
Stars: 3
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

Release Notes

Await previous write stream completion before accepting new stream
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics