Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to conduit-mirage 2.3.0 #742

Merged
merged 1 commit into from Feb 21, 2021
Merged

Adapt to conduit-mirage 2.3.0 #742

merged 1 commit into from Feb 21, 2021

Conversation

samoht
Copy link
Member

@samoht samoht commented Feb 2, 2021

@dinosaure
Copy link
Member

I would like to prefer to keep Cohttp_mirage.Make to be able to start a CoHTTP server without the Conduit plumbing - and, by this way, keep Cohttp_mirage.Server_with_conduit.

@dinosaure
Copy link
Member

This update becomes incompatible with git-cohttp-mirage where the ctx should not be a result of a functor. By design and initially, the ctx is defined outside a functor to let the end-user to use/fill/create it even if the Client (functor or not) is not available.

It's hard to follow the implication of that when I suspect some incompatible types somewhere with MirageOS/Functoria but I can not make a minimal example of it.

Note that git-cohttp-mirage can be easily updated - and functorized over PCLOCK/RESOLVER/CONDUIT on the other hand.

@samoht
Copy link
Member Author

samoht commented Feb 2, 2021

The current state of mirage-conduit (where first-class modules are mixed with functors) is super confusing. The current design simplify a lot of things (and allows to add http_client combinators to the mirage DSL). I will have a look at git-cohttp-mirage to see how hard it is to adapt.

@mseri
Copy link
Collaborator

mseri commented Feb 20, 2021

If we revert the last commit and run ocamlformat, this should also be good to go

@samoht
Copy link
Member Author

samoht commented Feb 20, 2021

commit reverted + ocamlformat applied

R.resolve_uri ~uri resolver >>= fun endp ->
Endpoint.client ?tls_authenticator:authenticator endp >>= fun client ->
match conduit with
| None -> failwith "conduit not initialised"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to use failwith instead of Lwt.raise or Lwt.failwith?

Copy link
Member

@dinosaure dinosaure Feb 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lwt.fail does not record the backtrace I believe

@samoht samoht added API and removed API labels Feb 21, 2021
@samoht samoht merged commit c3a59cd into mirage:master Feb 21, 2021
@samoht samoht deleted the conduit-2.3 branch February 21, 2021 13:02
@hannesm hannesm mentioned this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants