We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d5f990 commit 2c3d6d9Copy full SHA for 2c3d6d9
lib/async/http/body/pipe.rb
@@ -22,21 +22,18 @@
22
23
require_relative 'writable'
24
25
-require 'forwardable'
26
-
27
module Async
28
module HTTP
29
module Body
30
class Pipe
31
- extend Forwardable
32
+ # If the input stream is closed first, it's likely the output stream will also be closed.
33
def initialize(input, output = Writable.new, task: Task.current)
34
@input = input
35
@output = output
36
37
head, tail = IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
38
39
- @head = Async::IO::Stream.new(head)
+ @head = IO::Stream.new(head)
40
@tail = tail
41
42
@reader = nil
@@ -90,6 +87,7 @@ def writer(task)
90
87
end
91
88
ensure
92
89
@writer = nil
+
93
@output.close($!)
94
95
@head.close if @reader.nil?
0 commit comments