0 | module Node.HTTP.Agent
3 | import Node.Internal.Support
6 | data Agent : Type where [external]
14 | implementation Show Scheduling where
20 | record Options where
21 | constructor MkOptions
23 | keepAliveMsecs : Int
25 | maxTotalSockets : Int
26 | maxFreeSockets : Int
27 | scheduling : Scheduling
31 | defaultOptions : Options
32 | defaultOptions = MkOptions
34 | , keepAliveMsecs = 1000
35 | , maxSockets = 65535
36 | , maxTotalSockets = 65535
37 | , maxFreeSockets = 256
51 | keepAlive: _bool(keepAlive),
59 | ffi_convertOptions :
60 | (keepAlive : Bool) ->
61 | (keepAliveMsecs : Int) ->
62 | (maxSockets : Int) ->
63 | (maxTotalSockets : Int) ->
64 | (maxFreeSockets : Int) ->
65 | (scheduling : String) ->
68 | %foreign "node:lambda: (options) => new Agent(options)"
69 | ffi_newAgent : Node Options -> Agent
72 | newAgent : Options -> Agent
73 | newAgent o = ffi_newAgent $
ffi_convertOptions