Webmachine 1.2
Justin Sheehy - Justin Sheehy - May 26, 2009There are a few changes in webmachine-1.2 that deserve mention.
We simplified the API to the dispatcher module so that it can be used easily in a standalone fashion. In cases where another application (such as CouchDB) wants to use Webmachine-style dispatching, it is now easy to just call webmachine_dispatcher:dispatch/2 and get a useful result without any of the rest of Webmachine running. A trivial example:
1> webmachine_dispatcher:dispatch("/a",[{["a"],some_resource,[]}])
{some_resource,[],[],[],".",[]}
The other change that is most interesting from a feature point of view is that the request body is not read off the socket until the first time
wrq:req_body/1 is called. This means that a resource can (for example) return an error response code without having to wait for the body to be pulled off the wire first. There is also a change in the
new_webmachine project creation script. Your list of dispatch terms will now by default be in a separate file (“priv/dispatch.conf”) instead of directly in your application’s _sup file.This version is identified with the “webmachine-1.2” mercurial tag,
In upcoming versions, we hope to add a few much-clamored-for features such as host-based dispatching and incremental request/response body reading and writing.
Categories: Blogs Justin Sheehy
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» koher (koher): 本の並びが順に、Struts、SaaS、Slim3、Ajax、Spring、Scala、Erlang、Seasar2ってもうカオスだ…。
» josevalim (José Valim): Sweet. homebrew updated Erlang recipe to R15B, going to make it the required dependency for Elixir.
» stackfeed (StackOverflow): Erlang: unmarshalling variable length data fields in binary stream: I’m creating an Erlang application that need… http://t.co/0yDGJWz7
» tugocof (Bilski Storer): Viola Tricolor L. in Morphologischer, Anatomischer Und Biologischer Beziehung: Inaugural-Dissertation Zur Erlang… http://t.co/C4ojnX3h
» mickael (Mickaël Rémond): Hehe :)
RT @ostinelli spent the whole day in building an #ejabberd module. i just love this stuff. ^^_ #erlang
» darkproger (proger): RT @metabrew: If you use vim for #erlang, you might be interested in my rebar-friendly vimerl modifications: https://t.co/dSIKOs9p
» bipthelin (Bip Thelin): haven’t seen Hotline in a while RT “@github_erlang: hotline - Browser based Hotline client in Erlang http://t.co/mF50rC7D”
» erlang (Andreas Åkre Solberg): Mine bilder fra vakre Helgeland http://t.co/WNSNhNiw i min nye fancy bildefremviser
» github_erlang (GitHub Erlang): hotline - Browser based Hotline client in Erlang http://t.co/iLT9GmOG
» oki_dimas (Oki dimas mahendra ): Km wuching “@HammyDC: Bkan.. Aq dewa erlang.. RT @oki_dimas Bukan siluman “@HammyDC: Aq jdi yoko klo gtu..”
Statistics
Number of aggregated posts: 10454
Number of comments: 1392
Most recent article: January 31, 2012
Latest comments
» nobelboy on OpaDo Data Storage: Feel free to add some Qs here or contact me offline, and I will see what I can work into…
» darrensy on The Twisted Matrix: This has been a great idea you have shared. covers for kindle
» jony on Principle Software Engineer at LonoCloud (Full-time): That provides will become a internet marketer of little kinds of expert methods developers developing strategy using Erlang/OTP. There will…