91cb97b5 | 05-Apr-2023 |
Patrick Williams <patrick@stwcx.xyz> |
async: change namespace for sync_wait
Upstream stdexec moved the sync_wait from the `stdexec::this_thread` namespace directly into `stdexec`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Cha
async: change namespace for sync_wait
Upstream stdexec moved the sync_wait from the `stdexec::this_thread` namespace directly into `stdexec`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9a28b4c5920d0f9892ba466d919fd29f2397f64a
show more ...
|
da48d207 | 08-Mar-2023 |
Ed Tanous <edtanous@google.com> |
Fix vtable entires for offset callbacks
property_o didn't pass through the callbacks as sd-bus expected, so they can't be used for read-write properties. Add the expected methods.
Change-Id: Iad75
Fix vtable entires for offset callbacks
property_o didn't pass through the callbacks as sd-bus expected, so they can't be used for read-write properties. Add the expected methods.
Change-Id: Iad7592c99a60c22c10e274517ebfcbf8cf293a42 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
3edbe5c0 | 28-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Change io_service to io_context
This was renamed a while back in boost to be compliant with the std::executors proposal.
Change-Id: Ibb55df2b7c1e133621e354728115b89953d9e1bc Signed-off-by: Ed Tanou
Change io_service to io_context
This was renamed a while back in boost to be compliant with the std::executors proposal.
Change-Id: Ibb55df2b7c1e133621e354728115b89953d9e1bc Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
9688ed68 | 06-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Add override keyword everywhere it's required
Clang catches some of these. Add override keywords where we override functions, per cpp core guidelines.
Change-Id: I66f9e6dff53e07f0057d86a806701593b
Add override keyword everywhere it's required
Clang catches some of these. Add override keywords where we override functions, per cpp core guidelines.
Change-Id: I66f9e6dff53e07f0057d86a806701593be16b188 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
60a94305 | 06-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix meson warning
Meson warns on the calls to run_command.
WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in fu
Fix meson warning
Meson warns on the calls to run_command.
WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300
This commit does as meson recommends, and adds check: true to all run_command calls, which will be the default.
Change-Id: I281df6ed32c935ce7d3664a0ad628cc81dbac3a8 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
1837cd59 | 06-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Remove dead code paths
There's a few places where we call return after another return statement, or after a method that doesn't return. These are not required, and can be removed.
Change-Id: I0917
Remove dead code paths
There's a few places where we call return after another return statement, or after a method that doesn't return. These are not required, and can be removed.
Change-Id: I091716bd0eb8ad6aec7a54b66d175b348cbe00e0 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
cb2fbeb9 | 06-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Remove some extra semi-colons in tests
These snuck in here and cause clang warnings. Fix them.
Change-Id: I526cfee1ebc799eae48b92e790273f31462c655f Signed-off-by: Ed Tanous <edtanous@google.com> |
640a7d56 | 04-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Add support for appending std::string_view
std::string_view is used more in the project now that c++17 is available. It should be allowed as a base type in serialization of dbus interfaces.
To avo
Add support for appending std::string_view
std::string_view is used more in the project now that c++17 is available. It should be allowed as a base type in serialization of dbus interfaces.
To avoid an extra string copy, this function makes use of sd_bus_message_append_string_iovec, which allows appending in string pieces that might not be null terminated. This function is piped through the test framework, and interfaces to match.
Change-Id: Iee3e2cea9759fa9759cec98ab30c12c822aa3b73 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
5e7ef083 | 05-Jan-2023 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to later commit
The upstream code has done some namespace changes. Point to a commit in that timeframe and fix up the local usages in order to compile successfully.
Signed-off-by:
stdexec: update to later commit
The upstream code has done some namespace changes. Point to a commit in that timeframe and fix up the local usages in order to compile successfully.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I5a21ccd0774ee5cd22d45c9a425e43560734a571
show more ...
|
018b8ff1 | 05-Dec-2022 |
Patrick Williams <patrick@stwcx.xyz> |
shell: reformat with beautysh
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2717d31983fd17fab557bb92fc55e08e248f1159 |
6ea246af | 14-Oct-2022 |
Patrick Williams <patrick@stwcx.xyz> |
test: async: tweak time multiplier
When running under valgrind, the timing is a lot slower. Give a longer time interval for test cases to give some cushion.
Signed-off-by: Patrick Williams <patric
test: async: tweak time multiplier
When running under valgrind, the timing is a lot slower. Give a longer time interval for test cases to give some cushion.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie3e3a0d1960de2df1cea60763de8f57a3bcaa801
show more ...
|
115e9b3d | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: allow many exceptions
Allow many spawned tasks to throw exceptions and queue them up, re-throwing them one-by-one from `context::run` calls. Similarly enhance `context::scope` so th
async: context: allow many exceptions
Allow many spawned tasks to throw exceptions and queue them up, re-throwing them one-by-one from `context::run` calls. Similarly enhance `context::scope` so that many `context::empty` completions can complete with error.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I8744e0a3b8b0663ebd5ca26db0f5943688afe62a
show more ...
|
10483c94 | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: allow run re-entrance
Switch the context call so that it can be re-entrant. A single call to `run` will either:
1. Process until the context is successfully stopped. 2. An
async: context: allow run re-entrance
Switch the context call so that it can be re-entrant. A single call to `run` will either:
1. Process until the context is successfully stopped. 2. An exception is raised from a spawned task.
If an exception is raised, it could be caught outside the run call and then run called again.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Icd05df421a1f0592bd2390fbe8e21a16252eafed
show more ...
|
3c242ba4 | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: simplify run function
Since we already have a `spawn` function to add async tasks, get rid of the special "startup" task send to run. Instead users should pass the start up work to
async: context: simplify run function
Since we already have a `spawn` function to add async tasks, get rid of the special "startup" task send to run. Instead users should pass the start up work to spawn and call run with no parameters.
Eventually this will allow us to exit the run-loop for any and all exceptions from the async context and potentially allow a caller to re-enter the `run` loop after handling the child exception.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia0e09a2493f0554538315d1d0c238aa11cb44e39
show more ...
|
d6b05cc3 | 23-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
test: async: add a few recursive task tests
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I37b231e75b55c851c37600367da7ce1bc75e60af |
4cfc284d | 22-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: handle exceptions and stops
Add support in `context` and `scope` to handle exceptions and stop conditions:
* When an unhandled_stop occurs, turn it into an UnhandledStop exception. *
async: handle exceptions and stops
Add support in `context` and `scope` to handle exceptions and stop conditions:
* When an unhandled_stop occurs, turn it into an UnhandledStop exception. * When a `scope`-spawned task throws an exception, save it and cause `set_error` on the `scope::empty()`'s Receiver. * When anything in the `context` completes with `set_error` propagate that out to the caller of `context::run`. * If multiple exceptions occur within a `scope`, terminate.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I25285f7ece5c0675864489bbe1345fa8e7afa70c
show more ...
|
1b7b54ca | 21-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: match: stop pending sender on dtor
If the match is destructed with a pending Sender completion, we need to 'stop' that Sender. We cannot 'complete' the Sender because we do not have a messag
async: match: stop pending sender on dtor
If the match is destructed with a pending Sender completion, we need to 'stop' that Sender. We cannot 'complete' the Sender because we do not have a message (dbus signal) associated with the match, but if we do nothing then the Sender is hung (and leaked).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia6e465d46f0f7da08a385cf7c875bbda88a5ab61
show more ...
|
78e436fe | 21-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: handle shutdown better
When the context has been requested to stop we don't actually want to stop it until all work has completed. Work that is pending could require the dbus/event
async: context: handle shutdown better
When the context has been requested to stop we don't actually want to stop it until all work has completed. Work that is pending could require the dbus/event to function properly so we need to keep that running until that time. If we shutdown those too early, we can end up with a spawned task which never completes because it is relying on an event which is never processed.
In order to keep all of these straight, split the scope/stop_tokens into two: pending and internal. Pending tasks are for those 'spawned' due to the user requests and internal tasks are those maintained by the context itself to aid in processing. Defer shutting down the dbus/event handlers until all 'pending' work is completed.
Add a test-case which use to hang and now completes.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I399d065ae15b24ad3971c526c27b73757af14b34
show more ...
|
0139cac7 | 20-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add scope
In order to be able to create multiple subtasks as a collection and in order to make sure we keep good track of any tasks that are created by the context, add a `scope` as a contain
async: add scope
In order to be able to create multiple subtasks as a collection and in order to make sure we keep good track of any tasks that are created by the context, add a `scope` as a container of subtasks. This is partially modelled after the C++ P2519 proposal.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6e99b2fa2829d80c320491991f7e038f122963a9
show more ...
|
435eb1bd | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add sleep_for sender
Sometimes it is useful to do the equivalent of `std::this_thread::sleep_for` in a co-routine context. Add a sender-based implementation to async.
Signed-off-by: Patrick
async: add sleep_for sender
Sometimes it is useful to do the equivalent of `std::this_thread::sleep_for` in a co-routine context. Add a sender-based implementation to async.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9991eb40b7a1b12e61511f1200bc99fdcdbccf0a
show more ...
|
3ce3159b | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
event: add oneshot timer support
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9785fa52e38202821258ad162e6f9168c71e53f7 |
73e278b5 | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: support stopping the context
Up until this point, the async::context would run forever and have no way of exiting the process, which isn't very useful. Add some support for stop con
async: context: support stopping the context
Up until this point, the async::context would run forever and have no way of exiting the process, which isn't very useful. Add some support for stop conditions so that we can ask the context to stop and cleanly exit.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia5967162fb103d4b4b0490d8cbbef12bdb361bac
show more ...
|
d2b00440 | 16-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
event: add a simple wrapper around sd-event
In order to facilitate stop-conditions on the async::context, we need to be able to escape the wait on the dbus fd. sd-event will allow us to do this and
event: add a simple wrapper around sd-event
In order to facilitate stop-conditions on the async::context, we need to be able to escape the wait on the dbus fd. sd-event will allow us to do this and also build other co-routine primitives in the future (such as `co_await async::delay(1s)` backed by sd-event timers). Define a simple wrapper around sd-event here which can be leveraged by the async framework.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I945416cbce3c98d98135c42cb7ca249a57cb9a60
show more ...
|
2f58b791 | 26-Aug-2022 |
Patrick Williams <patrick@stwcx.xyz> |
async: add coroutine task support
Add sdbusplus::async::task<...> template which works with the std::executors proposal (P2300) and test-cases.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> C
async: add coroutine task support
Add sdbusplus::async::task<...> template which works with the std::executors proposal (P2300) and test-cases.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie63791daeab90ae1cc3862bb30878531b1775fa7
show more ...
|
1a25a10d | 29-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update whitespace penalty
clang-format-15 seems to end up with a slightly different whitespace break than clang-format-14 did. Tweak the PenaltyBreakAssignment to favor not breaking a
clang-format: update whitespace penalty
clang-format-15 seems to end up with a slightly different whitespace break than clang-format-14 did. Tweak the PenaltyBreakAssignment to favor not breaking as often, which allows the two to be more consistent.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I49826e2011bce317b6b82dc985ddd35fa6eef2cb
show more ...
|