Skip to content

cohttp-eio: confusing use of the ~sw argument #1006

@smondet

Description

@smondet

The Cohttp_eio.Client.call function takes a ~sw and returns a Body.t. calling Eio.Flow.read_all on the body after getting out of the Switch.run can cause a “use-after-close” exception from Eio:

Invalid-argument: readv: file descriptor used after calling close!

It gives the impression of defeating the purpose of eio-swtches, right?

PS: the documentation does say "Consume [response_body] in a timely fashion." which is a bit vague :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions