579 Commits

Author SHA1 Message Date
Denis Blank
ab9669fa2a Implement wait, wait_for and wait_until transforms properly
* wait is implemented by a atomic and default condition variable.
* wait_for and wait_until are expensive since we can't assume
  anything about the environment thus we have to allocate
  a persistent frame.
2020-04-04 01:11:27 +02:00
Denis Blank
df4d6ed971 Start to revise transforms 2020-04-04 00:04:51 +02:00
Denis Blank
957d3fa375 Align the cancel behaviour of result to the one used in the unhandled exception handler
* Introduce cancellation_result to represent a cancelled async task
* Add cancellation unit tests
* This doesn't allow cancellation of continuables, it is meant
  for treating the special state action canceled on the receiver side.
  Cancellation of a chain is still up to the user.
2020-04-03 22:34:08 +02:00
Denis Blank
c8c4325b5b Fix the unit tests by providing an ASSERT_ASYNC_CANCELLATION 2020-04-03 19:57:46 +02:00
Denis Blank
f1e9255eb9 Fix the test header includes 2020-04-03 19:47:42 +02:00
Denis Blank
85c0d76c7c Make make_cancelling_continuable throw an default constructed exception_t
* This behaviour now aligns on how cancellation is handled in the
  unhandled exception handler
2020-04-03 19:44:49 +02:00
Denis Blank
ca26bbbc87 Remap asio::error::basic_errors::operation_aborted to a default constructed exception_t
* Add a successful wait on the asio async timer
* Closes #27
* Closes #28
2020-04-03 19:38:13 +02:00
Denis Blank
564d134c75 Improve the clang-tidy and clang-format config 2020-04-03 18:13:41 +02:00
Denis Blank
f7e00bcc8d Store std::exception::what() automatically before calling TRAP on unhandled exceptions
* Makes it easier to inspect the message in debuggers
2020-04-03 17:44:40 +02:00
Denis Blank
89031d932c Rename cti::asio_token to cti::use_continuable
* support -> external
2020-04-03 17:25:52 +02:00
Christos Stratopoulos
1a1c7b68c6 Base implementation of an ASIO completion token integration
* Bump the asio version to 1.41
* Move headers that require an external dependency to include/continuable/support
* Ref #28
* Ref #27
2020-04-03 14:44:34 +02:00
Denis Blank
0b1b284e3a Add continuable_base::is_ready and continuable_base::unpack.
* Can be used to specialize the asynchronous control flow
  on immediate available asynchronous results mostly returned by:
    - make_ready_continuable
    - make_exceptional_continuable
* Usable to avoid longer unnecessary synchronous callback nestings.
* cti::query_arg_t was renamed into cti::unpack_arg_t.
* The continuation overload nowreturns result<Args...> rather
  than std::tuple<Args...>.
* Add is_ready optimizations to make_exceptional_continuable.
2019-12-26 10:13:20 +01:00
Denis Blank
117a716de1 Test the class which represents exception_t against true before running unhandled exception handlers.
* This allows cheap cancellation of the control flow by passing
  a default constructed `exception_t` object to `set_exception`.
* Since possible representatives like
    - `std::exception_ptr`
    - `std::error_code`
    - `std::error_condition`
  can be default constructed we have to test them anyway before possibly
  rethrowing them.
2019-11-16 17:13:23 +01:00
Denis Blank
cacb84371a Add MSVC 16 to the CI 2019-09-28 17:37:01 +02:00
Denis Blank
92d8bbad36 Fix the MSVC 16 build 2019-09-28 17:29:30 +02:00
Denis Blank
0afdbec2cc Upgrade the dependencies 2019-09-28 16:25:09 +02:00
Denis Blank
ffb3db7089 Fix the asio example
* Attempt to fix the GCC warning in a different way
2019-09-02 01:03:28 +02:00
Denis Blank
7aff2c0d9b Show the submodule revisions in Travis CI 2019-09-02 00:52:30 +02:00
Denis Blank
959f059a25 Fix a build error 2019-09-02 00:45:53 +02:00
Denis Blank
91d51e6543 Attempt to fix the clang/GCC build 2019-09-02 00:37:37 +02:00
Denis Blank
5e8bbe7c72 Use TYPED_TEST_SUITE instead of deprecated GTest TYPED_TEST_CASE 2019-09-02 00:24:07 +02:00
Denis Blank
dce0fbcffe Clean the playground since the test was moved into the unit tests 2019-09-02 00:17:17 +02:00
Denis Blank
a2fdfdfceb Use a promise<> for work rather than a dedicated work_base 2019-09-02 00:01:26 +02:00
Denis Blank
389002e918 Improve the work wrapper 2019-09-01 23:47:59 +02:00
Denis Blank
92368bccb7 Update submodules 2019-08-31 03:31:25 +02:00
Denis Blank
e09d26f3c6 First work on passing an exception to the executable work
* Make work r-value callable only by default
2019-08-31 03:30:03 +02:00
Denis Blank
422b6138cd Lift control flow compiler intrinsics into the used scope
* Also make UNREACHABLE trap in debug mode
2019-08-27 04:01:37 +02:00
Bogdan Vaneev
42af23fa03 Remove ccache
Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
2019-05-24 17:39:48 +02:00
Bogdan Vaneev
bcf55e88dd Add ccache
Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
2019-05-24 17:39:48 +02:00
Bogdan Vaneev
88fbcdbc17 Add ccache, add travis cache
Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
2019-05-24 17:39:48 +02:00
Bogdan Vaneev
c9d0e871cd Bump asio to 1.13.0
Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
2019-05-24 02:33:31 +02:00
Bogdan Vaneev
4cc7523380 Add regex to match AppleClang compiler
Signed-off-by: Bogdan Vaneev <warchantua@gmail.com>
2019-05-24 02:33:14 +02:00
Denis Blank
d842c14268 Re-enable the converting constructor of continuable_base
* Probably a forgotten leftover from debugging
  mainly responsible for more efficient conversions only.
2019-03-19 17:06:58 +01:00
Denis Blank
e9be3eb8c3 Improved the coroutine support auto detection on MSVC
* Based on _RESUMABLE_FUNCTIONS_SUPPORTED inspired from asio.
2019-03-15 17:11:38 +01:00
Denis Blank
67d77808dc Fix the GCC build after bc4d69735 2019-03-12 14:44:15 +01:00
Denis Blank
03ae1b5c45 Update function2 to Naios/function2@e3695b4 2019-03-12 14:43:50 +01:00
Denis Blank
bc4d69735c Improve cti::split and make it workable with plain callbacks 2019-03-11 16:39:35 +01:00
Denis Blank
daa2fdd686 Implement cti::split which makes it possible to resolve multiple
asynchronous control flows from a single promise.
2019-03-08 22:06:44 +01:00
Denis Blank
41f3429c85 Remove some using expressions
* Those caused issues in namespaces where symbols were preloaded
* Formatting fixes
2019-03-08 20:18:26 +01:00
Denis Blank
6b4f6de10f Use the work erased type directly in release builds
* So this behaviour aligns to the one used in continuable_base and promise_base.
2019-03-08 18:27:57 +01:00
Denis Blank
fdd9a061c4 Make promise_base default constructible
* This makes it possible to use promise_base for optional
  promises directly rather than wrapping it as optional<promise_base<...>>.
* Invalidate the promise_base after its first usage.
* Expose an `operator bool()` to make the validility accessible.
* Remove the no longer needed private promise_no_init_arg_t tag.
2019-03-08 18:13:40 +01:00
Denis Blank
2bc448b905 Link the MeetingC++ talk in the readme 2019-02-26 16:01:20 +01:00
Denis Blank
e23e363b03 Add a conanfile
* Closes #12
2019-01-29 20:28:09 +01:00
Denis Blank
d72e1bfb86 Implement async_on for asynchronous execution on a specific executor
* Makes it possible to specify an executor in addition to
  the arguments passed to async.
* The reason why async should not support this directly is
  that it should be closely modelled to std::async.
2019-01-26 03:46:39 +01:00
Denis Blank
fa589a1e95 Document range_loop 2019-01-14 23:14:29 +01:00
Denis Blank
20cd0191fc For loops provide loop_result loop_break and loop_continue for better readability 2019-01-14 23:13:23 +01:00
Denis Blank
76ecc3d26d Attempt to fix the build 2019-01-14 21:10:25 +01:00
Denis Blank
7491022d0f Implement make_plain to make it possible to not handle special objects in handlers 2019-01-14 21:02:22 +01:00
Denis Blank
4c807aec75 Update a deprecation message 2019-01-14 18:13:22 +01:00
Denis Blank
60b75a6134 Finish the async implementation 2019-01-14 18:07:37 +01:00