Skip to content

Commit 70ad494

Browse files
authored
add a public init to StreamWriter (#161)
1 parent 8031c46 commit 70ad494

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Sources/AsyncHTTPClient/HTTPHandler.swift

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ extension HTTPClient {
2626
public struct StreamWriter {
2727
let closure: (IOData) -> EventLoopFuture<Void>
2828

29+
/// Create new StreamWriter
30+
///
31+
/// - parameters:
32+
/// - closure: function that will be called to write actual bytes to the channel.
33+
public init(closure: @escaping (IOData) -> EventLoopFuture<Void>) {
34+
self.closure = closure
35+
}
36+
2937
/// Write data to server.
3038
///
3139
/// - parameters:

0 commit comments

Comments
 (0)