Roxen.git/
server/
etc/
modules/
Roxen.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2016-12-14
2016-12-14 12:22:38 by Martin Karlgren <marty@roxen.com>
e10f00daed442b46c2f7c51ca95b3f8aa12a8d24 (
21
lines) (+
21
/-
0
)
[
Show
|
Annotate
]
Branch:
7.0
Add Roxen.http_future() response function.
637:
return ([ "file":-1, "pipe":1, ]); }
+
//! Returns a response mapping indicating that the provided
+
//! @[Concurrent.Future] will be fulfilled with the request result.
+
//!
+
//! @param future
+
//! The @[Concurrent.Future] that will be fulfilled (by the caller).
+
//! It should be fulfilled with a response mapping, even for
+
//! non-fatal errors (such as 401, 404 etc.) On future failure, it
+
//! must fail with a Pike error (which will be handled the same
+
//! way as if a synchronous find_file call throws, i.e. "500
+
//! Internal server error" sent to the client and so on.)
+
//!
+
//! @param id
+
//! The @[RequestID] that will be used to send the response.
+
mapping(string:mixed) http_future (Concurrent.Future future, RequestID id)
+
{
+
future->on_success (id?->send_result);
+
future->on_failure (id?->send_internal_error);
+
return http_pipe_in_progress();
+
}
+
mapping(string:mixed) http_rxml_answer( string rxml, RequestID id, void|Stdio.File file, void|string type )