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).
On 1 Dec 2017, at 02:11, Stephen R. van den Berg srb@cuci.nl wrote:
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. [...]
I wrote the HTTP.Promise module back when the Concurrent.* stuff was added, but it was more of a hack and not thouroughly thought through, just to get the ball rolling. Since this is only available in 8.1 I personally see no problem with replacing the original module with the new one.
Regards ----------------------------- Pontus Östlund Developer • Roxen AB +46 70-662 81 69
www.roxen.com http://www.roxen.com/ | twitter.com/roxen https://twitter.com/roxen
pike-devel@lists.lysator.liu.se