-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Asio completion token support and thread-safe Session operations
- All asynchronous operations in Session now accept a generic completion token. - C++20 coroutines now supported by Session. - Added examples using Asio stackless coroutines, C++20 coroutines, and std::future. - Migrated from AsyncResult to new ErrorOr class which better emulates the proposed std::expected. - Session's asynchonous operations now return an ErrorOr result when passed a yield_context as the completion token, and will not throw if there was a runtime error. - Added Session::strand so that users may serialize access to the Session when using a thread pool. - Added Session overloads with the ThreadSafe tag type which can be called concurrently by multiple threads. - Added the SessionErrc::invalidState enumerator. - Renamed AnyExecutor to AnyIoExecutor. AnyExecutor is now deprecated. - Added AnyReusableHandler which type-erases a copyable multi-shot handler. - Added AnyCompletionHandler which is a Boost-ified version of the prototype asio::any_completion_handler. - Added AnyCompletionExecutor which is a Boost-ified version of the prototype asio::any_completion_executor. - Session and transports now extract a strand from the `Connector` passed by the user. - Moved corounpacker implementation to header directory root. - Added Realm::captureAbort. - Made config.hpp a public header. - Added DecodingErrc and DecodingCategory for deserialization errors not covered by jsoncons. - Session's setWarningHandler, setTraceHandler, setStateChangeHandler, and setChallengeHandler now take effect immediately even when connected. Those handlers are now executed via Session::userExecutor by default. - Boost.Asio cancellation slot support for Session::call. - Added withArgsTuple, convertToTuple and moveToTuple to Payload class. - Added the Deferment tag type (with 'deferment' constexpr variable) to more conveniently return a deferred Outcome from an RPC handler. - Renamed Cancellation to CallCancellation. Cancellation is now deprecated. - Renamed CancelMode to CallCancelMode. CancelMode is now deprecated. - Renamed Basic[Coro]<Event|Invocation>Unpacker to Simple[Coro]<Event|Invocation>Unpacker, with the former kept as deprecated aliases. - Renamed basic[Coro]<Event|Rpc> to simple[Coro]<Event|Rpc>, with the former kept as deprecated aliases. - Renamed the CppWAMP::coro-headers CMake target to CppWAMP::coro-usage, leaving the former as an alias. - Deprecated CoroSession, AsyncResult, error::Decode, and Outcome::deferred - Deprecated the Session::cancel overloads taking CallCancellation.
- Loading branch information
Showing
172 changed files
with
13,917 additions
and
4,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
#------------------------------------------------------------------------------- | ||
# Copyright Butterfly Energy Systems 2022. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# Copyright Butterfly Energy Systems 2022. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# https://www.boost.org/LICENSE_1_0.txt | ||
#------------------------------------------------------------------------------- | ||
|
||
add_library(cppwamp-coro-headers INTERFACE) | ||
target_compile_features(cppwamp-coro-headers INTERFACE cxx_std_11) | ||
target_link_libraries(cppwamp-coro-headers | ||
# Empty interface library for conveniently adding usage requirements to | ||
# projects wanting to use stackful coroutines. | ||
add_library(cppwamp-coro-usage INTERFACE) | ||
target_compile_features(cppwamp-coro-usage INTERFACE cxx_std_11) | ||
target_link_libraries(cppwamp-coro-usage | ||
INTERFACE | ||
CppWAMP::core-headers | ||
CppWAMP::coro-usage | ||
"$<TARGET_NAME_IF_EXISTS:Boost::coroutine>") | ||
set_target_properties(cppwamp-coro-headers PROPERTIES EXPORT_NAME coro-headers) | ||
add_library(CppWAMP::coro-headers ALIAS cppwamp-coro-headers) | ||
set_target_properties(cppwamp-coro-usage PROPERTIES EXPORT_NAME coro-usage) | ||
add_library(CppWAMP::coro-usage ALIAS cppwamp-coro-usage) | ||
|
||
# Deprecated aliases left for backward compatibility | ||
add_library(cppwamp-coro-headers ALIAS cppwamp-coro-usage) | ||
add_library(CppWAMP::coro-headers ALIAS cppwamp-coro-usage) |
Oops, something went wrong.