-
Notifications
You must be signed in to change notification settings - Fork 176
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
Further improve Cohttp_eio.Client ergonomics #958
Conversation
?conn:(#Eio.Flow.two_way as 'a) -> | ||
?port:port -> | ||
'b env -> | ||
host:host -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we decide to not use uri
here?
A uri
will contain all the information at once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure now but if I remember right being able to use the flow/connection
was one I think. It wasn't obvious to me then but now I think it was the correct design. Additionally, I believe we can't use unix
domain sockets in url without inventing our own syntax since http uri spec. doesn't specify how we can use unix
domain socket scheme in the uri.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, the main reason I am asking is because right now it feels weird to separate the host from the path (mostly because any other library will take that all at once) but this is surely an improvement over the previous version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try to be smart and add /
as the first character if not already present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try to be smart and add / as the first character if not already present?
I think that is a good idea but not sure atm. However, I would like to address that in future PR please if we do go down that route.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have created a new issue so that we can discuss it further. #959
While working on documentation for cohttp-eio and #957, it dawned on me that the
Cohttp_eio.Client
ergonomics could be further improved. Such that users ofCohttp_eio.Client
don't even need to useEio.Net.with_tcp_connect
for most use cases. This PR aims to do just that. Now we do,rather than a bit verbose below:
Note, however, we still retain the ability to pass in the
flow/connection
parameter like before. It is however now an optional parameter rather than a required one.