Files
scylladb/http
Amnon Heiman dca4b25e8b http: Allows function handler to return future
Function handler in general and json function in particular are the
easiest way to add logic to to handler.

While in some cases the method can return immediately, there are cases
when it is required to perform an async operation, to support those
cases, the function handler was modified to use future.

If it receives an old style function, it would wrap the results in a
make_ready_future. This you could still assign a function like:

new function_handler([](const_req req) {
        return "hello";
    });

It would no also support a function that return a future json so it is
no possible to assign logic like:
new function_handler([](std::unique_ptr<request> req) {
return make_ready_future<json::json_return_type>("json-future");
});

For the future case note that auto-boxing still works, although you now
need to use make_ready_future.

The json_path was also modified to accept the new kind of function, to
support the common case of route definition based on the code
generation.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-04-03 13:12:28 +03:00
..
2015-03-08 21:55:57 +02:00
2015-03-30 15:38:41 +03:00
2015-03-30 15:38:41 +03:00
2015-03-30 15:38:41 +03:00
2015-03-08 21:55:57 +02:00
2015-03-08 21:55:57 +02:00
2015-03-08 21:55:57 +02:00
2015-03-08 21:55:57 +02:00
2015-03-30 15:38:41 +03:00
2015-03-30 15:38:41 +03:00