wmorgan / heliotrope

A personal, threaded, search-centric email server.
124 stars 17 forks source link

Switch from 'rest-client' to Curb (libcurl bindings) #37

Closed stapelberg closed 12 years ago

stapelberg commented 12 years ago

Curl supports persistent HTTP connection and thus speeds up the communication with Heliotrope. This is especially noticable on slow links.

wmorgan commented 12 years ago

Sounds like a good idea. Thanks! I'm going to try this out a little bit first before merging.

wmorgan commented 12 years ago

Actually, this is noticeably faster. If you fix the above (minor) issues I will merge. Thanks!

stapelberg commented 12 years ago

Updated the code and commented on your comments. Can you have a look again please?

stapelberg commented 12 years ago

Updated again. Can you have a look again, please?

rakoo commented 12 years ago

There is much copy-paste with the @curl object parameterization and its error management, which should be managed by handle_errors

In fact I really liked the previous syntax :

helper[path].get
helper[path].get :params => params
helpert[path].post :params => params

which could be refactored into something like get_binary path, :params => params to look like the other one-liners

wmorgan commented 12 years ago

@rakoo: I would prefer a cleaner syntax too. I've merged it in. Additional cleanup commits are welcome. :)