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.
⭐️ 2
🕓 1 year 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: 2
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

Await previous write stream completion before accepting new stream
1 year ago

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