|
| 1 | +v0.10.0 |
| 2 | +====== |
| 3 | +Asio completion token support and thread-safe Session operations. |
| 4 | + |
| 5 | +- All asynchronous operations in Session now accept a generic |
| 6 | + [completion token](https://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/model/completion_tokens.html), |
| 7 | + which can either be a callback function, a `yield_context`, `use_awaitable`, |
| 8 | + or `use_future`. |
| 9 | +- C++20 coroutines now supported by Session. |
| 10 | +- Added examples using Asio stackless coroutines, C++20 coroutines, and |
| 11 | + std::future. |
| 12 | +- Migrated from `AsyncResult` to new `ErrorOr` class which better emulates |
| 13 | + the proposed `std::expected`. |
| 14 | +- `Session`'s asynchonous operations now return an `ErrorOr` result when passed |
| 15 | + a `yield_context` as the completion token, and will not throw if there was |
| 16 | + a runtime error. `ErrorOr::value` must be called to obtain the operation's |
| 17 | + actual result (or throw an exception if there was an error). |
| 18 | +- Added `Session::strand` so that users may serialize access to the `Session` |
| 19 | + when using a thread pool. |
| 20 | +- Added `Session` overloads with the `ThreadSafe` tag type which can be called |
| 21 | + concurrently by multiple threads. These overloads will be automatically |
| 22 | + dispatch operations via the `Session`'s execution strand. |
| 23 | +- Added the `SessionErrc::invalidState` enumerator which is now used to report |
| 24 | + errors when attempting to perform `Session` operations during an invalid |
| 25 | + session state. |
| 26 | +- Renamed `AnyExecutor` to `AnyIoExecutor` which aliases |
| 27 | + `boost::asio::any_io_executor`. AnyExecutor is now deprecated. |
| 28 | +- Added `AnyReusableHandler` which type-erases a copyable multi-shot handler, |
| 29 | + while storing the executor to which it is possibly bound. |
| 30 | +- Added `AnyCompletionHandler` which is a Boost-ified version of the prototype |
| 31 | + [asio::any_completion_handler] |
| 32 | + (https://github.com/chriskohlhoff/asio/issues/1100). |
| 33 | +- Added `AnyCompletionExecutor` which is a Boost-ified version of the prototype |
| 34 | + `asio::any_completion_executor`. |
| 35 | +- Session and transports now extract a |
| 36 | + [strand](https://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/core/strands.html) |
| 37 | + from the `Connector` passed by the user. |
| 38 | +- Moved corounpacker implementation to header directory root. |
| 39 | +- Added `Realm::captureAbort`. |
| 40 | +- Made config.hpp a public header. |
| 41 | +- Added DecodingErrc and DecodingCategory for deserialization errors |
| 42 | + not covered by jsoncons. |
| 43 | +- `Session`'s `setWarningHandler`, `setTraceHandler`, `setStateChangeHandler`, |
| 44 | + and `setChallengeHandler` now take effect immediately even when connected. |
| 45 | +- `Session`'s handlers for `setWarningHandler`, `setTraceHandler`, |
| 46 | + `setStateChangeHandler`, and `setChallengeHandler` are now executed via |
| 47 | + `Session::userExecutor` by default. |
| 48 | +- Boost.Asio [cancellation slot] |
| 49 | + (https://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/core/cancellation.html) |
| 50 | + support for `Session::call`. |
| 51 | +- Added `Rpc::withCancelMode` which specifies the cancel mode to use when |
| 52 | + triggered by Asio cancellation slots. |
| 53 | +- Added `withArgsTuple`, `convertToTuple` and `moveToTuple` to Payload class. |
| 54 | +- Added the `Deferment` tag type (with `deferment` constexpr variable`) to |
| 55 | + more conveniently return a deferred `Outcome` from an RPC handler. |
| 56 | +- Renamed `Cancellation` to `CallCancellation`. `Cancellation` is now a |
| 57 | + deprecated alias to ``CallCancellation`. |
| 58 | +- Renamed `CancelMode` to `CallCancelMode`. `CancelMode` is now a deprecated |
| 59 | + alias to `CallCancelMode`. |
| 60 | +- Renamed `Basic[Coro]<Event|Invocation>Unpacker` to |
| 61 | + `Simple[Coro]<Event|Invocation>Unpacker`, with the former kept as deprecated |
| 62 | + aliases. |
| 63 | +- Renamed `basic[Coro]<Event|Rpc>` to `simple[Coro]<Event|Rpc>`, with the |
| 64 | + former kept as deprecated aliases. |
| 65 | +- Renamed the CppWAMP::coro-headers CMake target to CppWAMP::coro-usage, |
| 66 | + leaving the former as an alias. |
| 67 | +- Deprecated `CoroSession` and `AsyncResult`. |
| 68 | +- Deprecated `error::Decode` |
| 69 | +- Deprecated the `Session::cancel` overloads taking `CallCancellation`. |
| 70 | +- Deprecated `Outcome::deferred`. |
| 71 | + |
| 72 | + |
| 73 | +### Breaking Changes |
| 74 | + |
| 75 | +- Bumped Boost version requirements to 1.77 to support Asio cancellation slots. |
| 76 | +- Errors due to attempting to perform an asynchronous `Session` operation during |
| 77 | + an invalid state are now emitted via the `ErrorOr` passed to the handler, |
| 78 | + instead of throwing `error::Logic`. This is to avoid `error::Logic` exceptions |
| 79 | + being thrown due to race conditions outside the library user's control (for |
| 80 | + example, calling a remote procedure just as the peer terminates the session). |
| 81 | + This also avoids the complications involved in transporting exceptions to |
| 82 | + coroutines, as well as having two mechanisms for reporting errors from the |
| 83 | + same function. |
| 84 | +- `Session::authenticate` no longer throws if the session is not in the |
| 85 | + `SessionState::authenticating` state. Instead, the authentication is discarded |
| 86 | + and a warning is emitted. |
| 87 | +- `Session::publish(Pub)` no longer throws if the session is not in the |
| 88 | + `SessionState::established` state. Instead, the publicatioon is discarded |
| 89 | + and a warning is emitted. |
| 90 | +- `Session::cancel` no longer throws if the session is not in the |
| 91 | + `SessionState::established` state. Instead, the cancellation is discarded |
| 92 | + and a warning is emitted. |
| 93 | +- Numeric values of enumerators following `SesesionErrc::invalidState` have |
| 94 | + been bumped by one. |
| 95 | +- `Session::call` no longer returns the request ID. To obtain the request ID, |
| 96 | + use the new `Session::call` overload which takes a `CallChit` out |
| 97 | + parameter by reference. |
| 98 | +- The signature of `lookupWampErrorUri` has been changed so that it returns |
| 99 | + whether the corresponding error code was found. |
| 100 | +- Codec decoders now return a std::error_code instead of throwing an exception. |
| 101 | +- The `Transport` type requirement has been changed so that it provides a |
| 102 | + `boost::asio::strand` instead of a `boost::asio::any_executor`. |
| 103 | + |
| 104 | +### Migration Guide |
| 105 | + |
| 106 | +- Replace `AnyExecutor` with `AnyIoExecutor`. |
| 107 | +- Replace `AsyncResult` with `ErrorOr`. |
| 108 | +- Replace `AsyncResult::get` with `ErrorOr::value`. |
| 109 | +- Replace `AsyncResult::errorCode` with `ErrorOr::error`. |
| 110 | +- Replace `AsyncResult::setValue` with `ErrorOr::emplace`. |
| 111 | +- Replace `Basic[Coro]<Event|Invocation>Unpacker` with |
| 112 | + `Simple[Coro]<Event|Invocation>Unpacker` |
| 113 | +- Replace `basic[Coro]<Event|Rpc>` with `simple[Coro]<Event|Rpc>` |
| 114 | +- Replace `Cancellation` with `CallCancellation` |
| 115 | +- Replace `CancelMode` with `CallCancelMode` |
| 116 | +- Replace `CoroSession<>` with `Session`. |
| 117 | +- Replace `Outcome::deferred` with `deferment`. |
| 118 | +- Replace `#include <cppwamp/corosession.hpp>` with |
| 119 | + `#include <boost/asio/spawn.hpp>` and `#include <cppwamp/session.hpp>`. |
| 120 | +- Add `.value()` to `Session` methods taking a `yield_context` to preserve the |
| 121 | + old behavior where either the result value is returned upon success or an |
| 122 | + exception is thrown upon failure. |
| 123 | +- `std::error_code` pointers cannot be passed to the the consolidated `Session` |
| 124 | + class. Instead check the returned `ErrorOr` result via `operator bool` and |
| 125 | + `AsyncResult::error()`. |
| 126 | +- `Session::call` no longer returns the RPC request ID. Instead use the |
| 127 | + `Session::call` overload which takes a `CallChit` out parameter by reference. |
| 128 | + Alternatively, you may bind an Asio cancellation slot to the completion token. |
| 129 | +- Replace `Session::cancel(CallCancellation)` usages with |
| 130 | + `Session::cancel(CallChit)`. |
| 131 | +- If used directly, check the `std::error_code` returned by codec decoders |
| 132 | + instead of catching `error::Decode` exceptions. |
| 133 | +- Replace the `CppWAMP::coro-headers` CMake target with `CppWAMP::coro-usage`. |
| 134 | + |
| 135 | + |
| 136 | +v0.9.2 |
| 137 | +====== |
| 138 | +Fixed the non-compilation of examples. |
| 139 | + |
| 140 | + |
1 | 141 | v0.9.1
|
2 | 142 | ======
|
3 | 143 | Add -fPIC when building vendorized static Boost libraries.
|
|
0 commit comments