File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,14 @@ responseAsStream :: forall eff w a. Response -> Readable w (http :: HTTP | eff)
126
126
127
127
Create a readable stream from a response object.
128
128
129
+ #### ` setTimeout `
130
+
131
+ ``` purescript
132
+ setTimeout :: forall eff. Request -> Int -> Eff (http :: HTTP | eff) Unit -> Eff (http :: HTTP | eff) Unit
133
+ ```
134
+
135
+ Set the socket timeout for a ` Request `
136
+
129
137
#### ` httpVersion `
130
138
131
139
``` purescript
Original file line number Diff line number Diff line change @@ -13,3 +13,13 @@ exports.requestImpl = function(opts) {
13
13
} ;
14
14
} ;
15
15
} ;
16
+
17
+ exports . setTimeout = function ( r ) {
18
+ return function ( ms ) {
19
+ return function ( k ) {
20
+ return function ( ) {
21
+ r . setTimeout ( ms , k ) ;
22
+ } ;
23
+ } ;
24
+ } ;
25
+ } ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ module Node.HTTP.Client
16
16
, requestFromURI
17
17
, requestAsStream
18
18
, responseAsStream
19
+ , setTimeout
19
20
, httpVersion
20
21
, responseHeaders
21
22
, statusCode
@@ -96,6 +97,9 @@ requestAsStream = unsafeCoerce
96
97
responseAsStream :: forall eff w a . Response -> Readable w (http :: HTTP | eff ) a
97
98
responseAsStream = unsafeCoerce
98
99
100
+ -- | Set the socket timeout for a `Request`
101
+ foreign import setTimeout :: forall eff . Request -> Int -> Eff (http :: HTTP | eff ) Unit -> Eff (http :: HTTP | eff ) Unit
102
+
99
103
-- | Get the request HTTP version
100
104
httpVersion :: Response -> String
101
105
httpVersion = _.httpVersion <<< unsafeCoerce
You can’t perform that action at this time.
0 commit comments