|
Boost-Commit : |
From: srajko_at_[hidden]
Date: 2007-05-19 14:30:03
Author: srajko
Date: 2007-05-19 14:30:03 EDT (Sat, 19 May 2007)
New Revision: 4138
URL: http://svn.boost.org/trac/boost/changeset/4138
Log:
rpc version 0.1
Text files modified:
sandbox/rpc/libs/rpc/doc/rpc.qbk | 2 +-
sandbox/rpc/libs/rpc/example/rpc_example.cpp | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
Modified: sandbox/rpc/libs/rpc/doc/rpc.qbk
==============================================================================
--- sandbox/rpc/libs/rpc/doc/rpc.qbk (original)
+++ sandbox/rpc/libs/rpc/doc/rpc.qbk 2007-05-19 14:30:03 EDT (Sat, 19 May 2007)
@@ -74,7 +74,7 @@
Below are the different versions of the RPC library:
-* version 0.1 5/19/2007 \[[@marshal_07_05_19.zip download]\]
+* version 0.1 5/19/2007 \[[@rpc_07_05_19.zip download]\]
* first implementation of the library using futures, making the RPC interface completely
asynchronous (with futures facilitating synchronous behavior).
* call options are deduced from the rpc call, and how the returned call handler is stored (or ignored).
Modified: sandbox/rpc/libs/rpc/example/rpc_example.cpp
==============================================================================
--- sandbox/rpc/libs/rpc/example/rpc_example.cpp (original)
+++ sandbox/rpc/libs/rpc/example/rpc_example.cpp 2007-05-19 14:30:03 EDT (Sat, 19 May 2007)
@@ -71,17 +71,21 @@
rpc::call<std::string, int (int)> call_inc__1("inc", 1);
// if the returned handler is ignored, nothing is marshaled back:
client(call_inc__1);
+
// if the returned handler is stored in an acknowledgement, only a confirmation of completion
// is marshaled back.
ack = client(call_inc__1);
BOOST_CHECK_NO_THROW(ack->completion().get());
- // if the returned handler is stored in a proper handler, we can get the return value
+
+ // if the returned handler is stored in a proper handler, the return value will be marshaled back
rpc::async_returning_handler<int>::ptr handler_int = client(call_inc__1);
boost::future<int> future_int(handler_int->return_promise());
BOOST_CHECK_EQUAL(future_int, 2);
+
// handler returners are imlplicitly convertible to futures, which will carry the returned value
boost::future<int> result_inc = client(call_inc__1);
BOOST_CHECK_EQUAL(result_inc, 2);
+
// handler returners are also convertible to values, which immediately
// get assigned the value of the return value future, making the call synchronous
int inced1 = client(call_inc__1);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk