> 5 maj 2016 kl. 13:40 skrev Mirar @ Pike developers forum 
> <10...@lyskom.lysator.liu.se>:
> 
> You might want to look into HTTP.Session, since that will handle
> things like reuse of connections and cookies. (I'm not saying it's
> intuitive, but it might be a better endpoint than Query for a
> Concurrent solution.)

Good call! I’ll take a look at that.

> (Query was never written not to have a layer on top of it.)

Yes, but still, stuff like this is a bit cumbersome I think:

Protocols.HTTP.Query q = Protocols.HTTP.Query();

q->set_callbacks(
  lambda (Protocols.HTTP.Query c) {
    c->timed_async_fetch(
      lambda (Protocols.HTTP.Query data) {
        werror(”Got data ok\n”);
      },
      lambda (Protocols.HTTP.Query fail) {
        werror(”Failed getting data\n”);
      });
  },
  lambda (Protocols.HTTP.Query c) {
    werror(”Connection error\n”);
  });

Protocols.HTTP.do_async_method(”GET”, ”http://foo.bar <http://foo.bar/>”, 0, 0, 
q);
  
Cheers!

# Pontus

Reply via email to