Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
c4dee33c
Commit
c4dee33c
authored
Dec 13, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More clarifications.
parent
af2e7f57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
2013-12-12-capnproto-0.4-time-travel.md
doc/_posts/2013-12-12-capnproto-0.4-time-travel.md
+9
-1
rpc.md
doc/rpc.md
+7
-0
No files found.
doc/_posts/2013-12-12-capnproto-0.4-time-travel.md
View file @
c4dee33c
...
...
@@ -24,10 +24,18 @@ _UPDATE: There has been some confusion about what I'm claiming. I am NOT sayin
promises alone (i.e. being asynchronous) constitutes "time travel". Cap'n Proto implements a
technique called Promise Pipelining which allows a new request to be formed based on the content
of a previous result (in part or in whole) before that previous result is returned. Notice in the
diagram that the result of foo() is being passed to bar()._
diagram that the result of foo() is being passed to bar(). Please
[
see the docs
](
{{
site.baseurl }}rpc.html) or
[
check out the calculator example
](
https://github.com/kentonv/capnproto/blob/master/c++/samples
)
for more._
### Promises in C++
_UPDATE: More confusion. This section is
**not**
about pipelining ("time travel"). This section
is just talking about implementing a promise API in C++. Pipelining is another feature on top of
that. Please
[
see the RPC page
](
{{
site.baseurl }}rpc.html) if you want to know more about
pipelining._
If you do a lot of serious Javascript programming, you've probably heard of
[
Promises/A+
](
http://promisesaplus.com/
)
and similar proposals. Cap'n Proto RPC introduces a
similar construct in C++. In fact, the API is nearly identical, and its semantics are nearly
...
...
doc/rpc.md
View file @
c4dee33c
...
...
@@ -87,6 +87,8 @@ foo = root.open("foo"); # 1
bar = foo.open("bar"); # 2
size = bar.size(); # 3
data = bar.read(0, size); # 4
# The above is four calls but takes only one network
# round trip with Cap'n Proto!
{% endhighlight %}
In such a high-latency scenario, making your interface elegant is simply not worth 4x the latency.
...
...
@@ -137,6 +139,11 @@ need to change our interface at all. We keep our simple, elegant, singleton-fre
don't have to implement path strings, caching, authentication, or authorization, and yet everything
performs as well as we can possibly hope for.
#### Example code
[
The calculator example
](
https://github.com/kentonv/capnproto/blob/master/c++/samples/calculator-client.c++
)
uses promise pipelining. Take a look at the client side in particular.
### Distributed Objects
As you've noticed by now, Cap'n Proto RPC is a distributed object protocol. Interface references --
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment