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
382d9930
Commit
382d9930
authored
Apr 10, 2017
by
Kenton Varda
Committed by
GitHub
Apr 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #436 from ryanofsky/pr/lazy
doc/cxxrpc: Document lazy execution
parents
548f1f63
ec0f87e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
cxxrpc.md
doc/cxxrpc.md
+12
-0
No files found.
doc/cxxrpc.md
View file @
382d9930
...
...
@@ -154,6 +154,18 @@ callbacks simply won't be executed. If you need explicit notification when a pr
you can use its
`attach()`
method to attach an object with a destructor -- the destructor will be
called when the promise either completes or is canceled.
### Lazy Execution
Callbacks registered with
`.then()`
which aren't themselves asynchronous (i.e. they return a value,
not a promise) won't be executed by default. There are several ways to force a promise to execute
eagerly:
*
`.wait()`
on it.
*
`.detach()`
it.
*
Add it to a
`kj::TaskSet`
(this is a lot like
`detach()`
, except that you can cancel all tasks in
the set by destroying the set).
*
Call
`.eagerlyEvaluate()`
on it.
### Other Features
KJ supports a number of primitive operations that can be performed on promises. The complete API
...
...
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