Commit Graph

16 Commits

Author SHA1 Message Date
oliver Kowalke
19fcdf5d2c fix example adapt_callback: wrap callback+args for C++11 2016-05-03 09:29:27 +02:00
Oliver Kowalke
f89e5fc7e8 isoem fixes for example adapt_callback 2016-05-01 19:02:57 +02:00
Nat Goodspeed
0e2f382285 Bind promise with init capture if available, else use std::bind. 2016-05-01 10:33:54 -04:00
Oliver Kowalke
6fb1c627ac fix adatp_callbacks.cpp 2016-02-17 19:48:25 +01:00
Oliver Kowalke
f48cbd6f2f adatp-callbacks: C++11 does not support generalized lambda captures 2016-02-17 17:17:55 +01:00
Oliver Kowalke
b56d95b8fc fix example adapt_callbacks
C++11 does not support generalized lambda captures
2016-02-16 11:06:32 +01:00
Nat Goodspeed
3b9e9a3a56 Snapshot of documentation update for 2016 review.
Note effect of BOOST_USE_SEGMENTED_STACKS if StackAllocator is not explicitly
passed.

Introduce function_heading_for QuickBook template to allow separate
descriptions of swap(fiber), swap(packaged_task) and swap(promise).

Document async() using C++14 std::result_of_t and std::decay_t, aligning with
std::async() documentation.

Rework when_any / when_all examples to use unbounded_channel throughout, since
we always close() the channel after the first value anyway. bounded_channel
doesn't really add much value here.

Make wait_first_outcome_impl() infer its channel pointer type. That way we can
reuse that function instead of coding a separate wait_all_until_error_impl(),
which differs only in using the nchannel facade instead of directly pushing to
unbounded_channel.

Explain use of std::bind() to bind a lambda.

Use a more nuanced discussion of promise lifetime in write_ec() example
function.

Use condition_variable::wait(lock, predicate) in a couple places in
work_sharing.cpp example.
2016-02-06 23:17:04 -05:00
Oliver Kowalke
253d981f52 examples added 2015-09-29 17:55:46 +02:00
Oliver Kowalke
eafeaaae01 remove examples and tests 2015-09-16 19:12:57 +02:00
Oliver Kowalke
e44a41b71e add output 'done' at the end of examples 2015-09-11 18:41:46 +02:00
Oliver Kowalke
fefffd37eb update documentation 2015-09-01 17:17:38 +02:00
Oliver Kowalke
aa79e05d25 fix code format in examples 2015-08-24 19:52:00 +02:00
Nat Goodspeed
1e3e2b8887 Add callbacks.qbk about interfacing Fiber with async callbacks.
This covers both generic callbacks (adapt_callbacks.cpp,
adapt_method_calls.cpp) and custom Asio completion tokens (yield.hpp,
promise_completion_token.hpp, detail/yield.hpp, detail/promise_handler.hpp).
Mark up the relevant source files to provide code snippets for callbacks.qbk.
2015-08-24 09:28:16 -04:00
Nat Goodspeed
68044bb349 Don't embed semantically meaningful function calls in assert(). 2015-08-23 17:15:30 -04:00
Nat Goodspeed
550aae5029 Add examples/adapt_method_calls.cpp.
This illustrates how to interface a synchronous Fiber function with an async
API whose notification consists of an abstract base class with virtual
success/error methods.
2015-08-23 11:53:33 -04:00
Nat Goodspeed
7beab5b285 Add examples/adapt_callbacks.cpp.
This illustrates a few different ways of using promise and future to interface
between an asynchronous callback and the Fiber library.
2015-08-23 11:17:10 -04:00