Branch: Tag:

2016-05-09

2016-05-09 22:21:49 by Pontus Östlund <poppanator@gmail.com>

Protocols.HTTP.Query: Fixed an old bug (https://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=7676) where basically the timeout in timed_async_fetch wasn't reset each new data read.
This timeout had it's own property (data_timeout) which now is "deprecated" since the property "timeout" pretty much serves the same purpose, but on connection. So now timeout is the default value to use unless data_timeout is explicitly set, in which case that value will be used.
Since there was no proper way to set a max time for the entire operation (well, that was by accident and not intention how the data_timeout in timed_async_fetch worked) the new property "maxtime" has been added. If this is set (default is 0=indefinetly) the request will be aborted after maxtime second even if data is still being read.

So in short:

data_timeout = 0 // unless explicitly set
timeout = 120 // connection timeout, and then data read timeout
maxtime = 0 // 0 = off, otherwise the entire operation must be done within maxtime seconds or else the request is aborted

Protocols.HTTP.Session: Added some documentation

Protocols.HTTP.Promise: New module which utilise the new Concurrent.Promise/Future stuff for HTTP requests. Internally uses Protcols.HTTP.Session for the actual HTTP stuff.

Web.Api.Api: Now fetches data asynchronously when async calls are made.

Concurrent: on_success and on_fail now returns the object being called so that they can be chained.

Parser.Markdown: Fixed the #require macro directive.

54:    }       //! Register a callback that is to be called on fulfillment. -  void on_success(function(mixed, mixed ... : void) cb, mixed ... extra) +  this_program on_success(function(mixed, mixed ... : void) cb, mixed ... extra)    {    object key = mux->lock();    success_cb = cb;
65:    if (s == STATE_FULFILLED) {    call_out(cb, 0, res, @extra);    } +  +  return this;    }       //! Register a callback that is to be called on failure. -  void on_failure(function(mixed, mixed ... : void) cb, mixed ... extra) +  this_program on_failure(function(mixed, mixed ... : void) cb, mixed ... extra)    {    object key = mux->lock();    failure_cb = cb;
79:    if (s == STATE_REJECTED) {    call_out(cb, 0, res, @extra);    } +  return this;    }       //! Apply @[fun] with @[val] followed by the contents of @[ctx],