commit | f19375037364feb449757281848ede27682da548 | [log] [tgz] |
---|---|---|
author | Yifei Teng <yifeit@google.com> | Tue Mar 28 19:55:30 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Mar 28 19:55:30 2023 +0000 |
tree | 89cdb2160ba8effeb9573bf04e22c54ac269e352 | |
parent | e6287157c447dd026d1c4d5124070ff075ab52d7 [diff] |
[bedrock] Add an async task runnable for testing Often we want to run some logic as a new program/runnable. The task::create_task function wraps a Future<()> into a runnable that also supports cancellation and observing exit. Two refactors to make this work: - Introduced a Lifecycle trait under Program, that exposes an on_exit with user specifiable exit information type. - stop takes a &mut self, since stopping a task apparently requires, umm, modifying the task. Bug: 122024 Change-Id: I917c2251638811354629b33167457c055d8c3625 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/825958 Reviewed-by: Yegor Pomortsev <ypomortsev@google.com> Commit-Queue: Yifei Teng <yifeit@google.com> Reviewed-by: Claire Gonyeo <cgonyeo@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.