hoplon / castra

HTTP remote procedure call handler for Clojure.
170 stars 25 forks source link

introduce the state function #18

Closed jumblerg closed 8 years ago

jumblerg commented 8 years ago

the state function, when passed to the castra middleware, further segregates an application's command and query responsibilities. by assuming the duty of updating the application state, the state function frees rpc commands to return their own results to the application.

the middleware first executes the command to mutate the application data, then evaluates the state function to query it. both the result and the piggybacking application data are returned over the same http response and mapped respectively to the call site and reference type.

boxxxie commented 8 years ago

what would be an example use-case?