Are there many users of Protocols.HTTP.Promise already?
I made a less filling version, with slightly changed API.
The new one is called Protocols.HTTP.Promise2 at the moment; if there are
no objections, I'd replace HTTP.Promise with this one.
Most notable differences between HTTP.Promise2 and HTTP.Promise:
a. Less filling (20% smaller compiled object file).
b. Instead of two result objects, we simply have a single
HTTP.Promise.Result object which is passed both on_success()
and on_failure(). Why does the original separate this in a
Promise.Success and Promise.Failure type?
c. Various code optimisations, that do not change the interface.
d. The Result object lacks the ok() method. What use was/is it?
You should normally already know if you are a success or a failure
callback.
e. The Result object returns the raw body through "data", and the decoded
body through get() (to conform more to standard Future objects).
--
Stephen.