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

lhttpc -> hackney. fixes #17 #21

Merged
merged 1 commit into from
Feb 15, 2016
Merged

lhttpc -> hackney. fixes #17 #21

merged 1 commit into from
Feb 15, 2016

Conversation

andreineculau
Copy link
Member

Hackney WARNING: Supported versions of Erlang are R16B03-1, 17.3.4 and above. It is reported to work with R14B04 and R15B03-1.

%% http_request_now(Url, Method, Hdrs, Body, Timeout, []).
katt_callbacks:http_request_now(Url, Method, Hdrs, Body, Timeout, []).

http_request_now(Url, Method, Hdrs, Body, Timeout, []) ->

Choose a reason for hiding this comment

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

Why not move this to katt_util? Then you wouldn't have the problem of having to explain yourself re meck.

Choose a reason for hiding this comment

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

Also maybe just explain that you're doing this because you want to resemble the signature of lhttpc, that has been used before. Btw, I think that fusco retains lhttpc's signature.

Copy link
Member Author

Choose a reason for hiding this comment

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

re: Why not move this to katt_util?
Not a bad idea, actually: ~katt_util:external_http_request.
But the argumentation fails to hit home :) *_util shouldn't be a dump for all internal functions you want to meck.

re: lhttpc signature - unfinished PR. Obviously the signature and the tests should be cleaned up.. By who? Let me turn the wheel of fortune and I tell you right away:)
Well, the tests themselves need proper work irrespective of this PR (there must be a clean=readable=maintainable way to test katt).

re: fusco - I hope you're not arguing that one should choose fusco just because I'd keep the call signature intact :) Went with hackney in this PR due to longevity (# of commits) and popularity (# of github stars).

Choose a reason for hiding this comment

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

Re: util - I don't see a reason why a wrapper around an http client shouldn't be in some *_util, except for when it would go to its own module. Apart from that, why "external"?

Re: fusco - we switched to it for almost any of our internal and opensource projects, it's probably not the worst. I think it can be regarded as the official successor of lhttpc. That said, nothing against using hackney either.

I could offer to clean that up if you could be more clear what has to be done besides replacing lhttpc. What's wrong with the tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Re: util - I don't see a reason why a wrapper around an http client shouldn't be in some *_util,

because it doesn't have any utility outside katt.erl,.. or to put it differently - if it wasn't for lhttpc-> hackney, for meck, and then for the required module-prefixed call, would you have looked at the code and though "hmm, this http_request wrapper around lhttp:request" should probably go out of katt.erl into katt_util.erl ?

re: tests - #22 :p Nothing wrong, but it's not easy(tm) to just add a simple test. Reminds me of yaws testing :)

@andreineculau
Copy link
Member Author

ping @sstrigler - if travis is happy, are you also happy after this last commit? :)

andreineculau added a commit that referenced this pull request Feb 15, 2016
@andreineculau andreineculau merged commit c842dad into develop Feb 15, 2016
@andreineculau andreineculau deleted the no-lhttpc-17 branch March 7, 2016 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants