dlang-requests 0.4.0 released

ikod via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Dec 29 02:22:24 PST 2016


Hi,

dlang-requests v0.4.0 released.

Major new feature - threaded request pool, which works like 
InputRange. You can write code like this:


      iota(10).
          map!(n => "%d".format(n).representation).
          map!(d => 
Job("http://httpbin.org/post").method("POST").data(d)).
          pool(5).
          filter!(r => r.code == 200).
          each!(r => writeln(cast(string)r.data));

You can supply requests to different hosts/ports, and Pool object 
will run your requests in parallel, trying to reduce response 
delay by routing each request to proper keep-alive connection.

Any InputRange with front() type Job can be supplied to pool. 
Pool produce InputRange of Result's.

Another improvement related to FTP authentication. You can use 
same method (rq.authenticator) as for HTTP requests to avoid 
problems when login/password contains reserved symbols (like "@").

If you have any ideas to implement, or issues to report - you are 
welcome to project page https://github.com/ikod/dlang-requests

Best regards!



More information about the Digitalmars-d-announce mailing list