rschildmeijer / deft

High performance non blocking web framework
http://www.deftserver.org
Apache License 2.0
196 stars 25 forks source link

Simple asynchronous http client #97

Closed rschildmeijer closed 13 years ago

rschildmeijer commented 13 years ago

The http client should run inside Deft's ioloop.

rschildmeijer commented 13 years ago

Proposed high level api design: AsynchronousHttpClient http = new AsynchronousHttpClient(); http.fetch("http://deftserver.org/", new AsyncResult { ... }); // or http.fetch(httpRequestObject, new AsyncResult { ... }); IOLoop.INSTANCE.start();

rschildmeijer commented 13 years ago

I think we want something like the IOStream (simply a decorated socket) class before we start rolling our own http client. (loft: https://github.com/rschildmeijer/loft/blob/master/src/io/loft/IOStream.scala) (The iostream will certainly make it easier for other third party libraries)

rschildmeijer commented 13 years ago

looking into this...

rschildmeijer commented 13 years ago

http://httpstat.us/ could be useful while debugging the http client

rschildmeijer commented 13 years ago

Current status: https://gist.github.com/842452 (work in progress..) Could be interesting to let eg. apache httpclient or https://github.com/AsyncHttpClient/async-http-client do the actual http response parsing (to avoid "reinventing the wheel") (i.e give the raw byte[]/String (that contains the HTTP response) to one of the above)

rschildmeijer commented 13 years ago

Implements #97 (Simple asynchronous http client) (closed by 51e8d37e76dcdf171767bd6a616ae524c15c7f4a) patch by rschildmeijer