aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen <benlawson@google.com>2023-03-15 23:10:23 +0000
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-15 23:10:23 +0000
commit34076be2bf875f231f9418e30482fef7cca24b7a (patch)
tree0ce13baa91d611a6fd68e27af2d2c9418816a0dc
parent487275b46a496f3f5976348e36d56fb4c4e7d81f (diff)
downloadpigweed-34076be2bf875f231f9418e30482fef7cca24b7a.tar.gz
pw_async: Rename Dispatcher::Post*() methods
Rename Dispatcher::Post*() methods for consistency and brevity. Change-Id: Iaeaa326a540cc90d8baf47992e87436d25a2efa6 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/133934 Reviewed-by: Erik Gilling <konkers@google.com> Reviewed-by: Keir Mierle <keir@google.com> Commit-Queue: Ben Lawson <benlawson@google.com>
-rw-r--r--pw_async/docs.rst4
-rw-r--r--pw_async/fake_dispatcher_test.cc44
-rw-r--r--pw_async/public/pw_async/dispatcher.h21
-rw-r--r--pw_async/public/pw_async/fake_dispatcher.h27
-rw-r--r--pw_async_basic/dispatcher.cc21
-rw-r--r--pw_async_basic/dispatcher_test.cc42
-rw-r--r--pw_async_basic/docs.rst2
-rw-r--r--pw_async_basic/fake_dispatcher.cc22
-rw-r--r--pw_async_basic/fake_dispatcher_fixture_test.cc2
-rw-r--r--pw_async_basic/public/pw_async_basic/dispatcher.h19
-rw-r--r--pw_async_basic/public/pw_async_basic/fake_dispatcher.h14
-rw-r--r--pw_async_basic/size_report/post_1_task.cc2
12 files changed, 104 insertions, 116 deletions
diff --git a/pw_async/docs.rst b/pw_async/docs.rst
index a892be7f5..e1a34e009 100644
--- a/pw_async/docs.rst
+++ b/pw_async/docs.rst
@@ -119,7 +119,7 @@ Next, instantiate the Dispatcher and post a task:
});
// Execute `task` in 5 seconds.
- dispatcher.PostDelayedTask(task, 5s);
+ dispatcher.PostAfter(task, 5s);
// Blocks until `task` runs.
work_thread.join();
@@ -141,7 +141,7 @@ the current/main thread:
});
// Execute `task` in 5 seconds.
- dispatcher.PostDelayedTask(task, 5s);
+ dispatcher.PostAfter(task, 5s);
dispatcher.Run();
return 0;
diff --git a/pw_async/fake_dispatcher_test.cc b/pw_async/fake_dispatcher_test.cc
index 353997c53..2757e33e1 100644
--- a/pw_async/fake_dispatcher_test.cc
+++ b/pw_async/fake_dispatcher_test.cc
@@ -34,20 +34,20 @@ TEST(FakeDispatcher, PostTasks) {
};
Task task(inc_count);
- dispatcher.PostTask(task);
+ dispatcher.Post(task);
Task task2(inc_count);
- dispatcher.PostTask(task2);
+ dispatcher.Post(task2);
Task task3(inc_count);
- dispatcher.PostTask(task3);
+ dispatcher.Post(task3);
// Should not run; RunUntilIdle() does not advance time.
Task task4([&count]([[maybe_unused]] Context& c, Status status) {
ASSERT_CANCELLED(status);
++count;
});
- dispatcher.PostDelayedTask(task4, 1ms);
+ dispatcher.PostAfter(task4, 1ms);
dispatcher.RunUntilIdle();
dispatcher.RequestStop();
@@ -72,15 +72,15 @@ TEST(FakeDispatcher, DelayedTasks) {
ASSERT_OK(status);
tp.count = tp.count * 10 + 4;
});
- dispatcher.PostDelayedTask(task0, 200ms);
+ dispatcher.PostAfter(task0, 200ms);
Task task1([&tp]([[maybe_unused]] Context& c, Status status) {
ASSERT_OK(status);
tp.count = tp.count * 10 + 1;
- c.dispatcher->PostDelayedTask(tp.task_a, 50ms);
- c.dispatcher->PostDelayedTask(tp.task_b, 25ms);
+ c.dispatcher->PostAfter(tp.task_a, 50ms);
+ c.dispatcher->PostAfter(tp.task_b, 25ms);
});
- dispatcher.PostDelayedTask(task1, 100ms);
+ dispatcher.PostAfter(task1, 100ms);
tp.task_a.set_function([&tp]([[maybe_unused]] Context& c, Status status) {
ASSERT_OK(status);
@@ -106,11 +106,11 @@ TEST(FakeDispatcher, CancelTasks) {
TaskPair tp;
// This task gets canceled in cancel_task.
tp.task_a.set_function(shouldnt_run);
- dispatcher.PostDelayedTask(tp.task_a, 40ms);
+ dispatcher.PostAfter(tp.task_a, 40ms);
// This task gets canceled immediately.
Task task1(shouldnt_run);
- dispatcher.PostDelayedTask(task1, 10ms);
+ dispatcher.PostAfter(task1, 10ms);
ASSERT_TRUE(dispatcher.Cancel(task1));
// This task cancels the first task.
@@ -119,7 +119,7 @@ TEST(FakeDispatcher, CancelTasks) {
ASSERT_TRUE(c.dispatcher->Cancel(tp.task_a));
++tp.count;
});
- dispatcher.PostDelayedTask(cancel_task, 20ms);
+ dispatcher.PostAfter(cancel_task, 20ms);
dispatcher.RunFor(50ms);
dispatcher.RequestStop();
@@ -139,8 +139,8 @@ TEST(FakeDispatcher, RequestStopInsideTask) {
// These tasks are never executed and cleaned up in RequestStop().
Task task0(cancelled_cb), task1(cancelled_cb);
- dispatcher.PostDelayedTask(task0, 20ms);
- dispatcher.PostDelayedTask(task1, 21ms);
+ dispatcher.PostAfter(task0, 20ms);
+ dispatcher.PostAfter(task1, 21ms);
Task stop_task([&count]([[maybe_unused]] Context& c, Status status) {
ASSERT_OK(status);
@@ -148,7 +148,7 @@ TEST(FakeDispatcher, RequestStopInsideTask) {
c.dispatcher->RequestStop();
c.dispatcher->RunUntilIdle();
});
- dispatcher.PostTask(stop_task);
+ dispatcher.Post(stop_task);
dispatcher.RunUntilIdle();
ASSERT_EQ(count, 3);
@@ -162,14 +162,14 @@ TEST(FakeDispatcher, PeriodicTasks) {
ASSERT_OK(status);
++count;
});
- dispatcher.SchedulePeriodicTask(periodic_task, 20ms, dispatcher.now() + 50ms);
+ dispatcher.PostPeriodicAt(periodic_task, 20ms, dispatcher.now() + 50ms);
// Cancel periodic task after it has run thrice, at +50ms, +70ms, and +90ms.
Task cancel_task([&periodic_task](Context& c, Status status) {
ASSERT_OK(status);
c.dispatcher->Cancel(periodic_task);
});
- dispatcher.PostDelayedTask(cancel_task, 100ms);
+ dispatcher.PostAfter(cancel_task, 100ms);
dispatcher.RunFor(300ms);
dispatcher.RequestStop();
@@ -187,9 +187,9 @@ TEST(FakeDispatcher, TasksCancelledByDispatcherDestructor) {
{
FakeDispatcher dispatcher;
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
}
ASSERT_EQ(count, 3);
@@ -204,9 +204,9 @@ TEST(DispatcherBasic, TasksCancelledByRunFor) {
Task task0(inc_count), task1(inc_count), task2(inc_count);
FakeDispatcher dispatcher;
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
dispatcher.RequestStop();
dispatcher.RunFor(5s);
diff --git a/pw_async/public/pw_async/dispatcher.h b/pw_async/public/pw_async/dispatcher.h
index 7000a3732..eb07a84e8 100644
--- a/pw_async/public/pw_async/dispatcher.h
+++ b/pw_async/public/pw_async/dispatcher.h
@@ -37,26 +37,23 @@ class Dispatcher : public chrono::VirtualSystemClock {
virtual void RequestStop() = 0;
/// Post caller owned |task|.
- virtual void PostTask(Task& task) = 0;
+ virtual void Post(Task& task) = 0;
/// Post caller owned |task| to be run after |delay|.
- virtual void PostDelayedTask(Task& task,
- chrono::SystemClock::duration delay) = 0;
+ virtual void PostAfter(Task& task, chrono::SystemClock::duration delay) = 0;
/// Post caller owned |task| to be run at |time|.
- virtual void PostTaskForTime(Task& task,
- chrono::SystemClock::time_point time) = 0;
+ virtual void PostAt(Task& task, chrono::SystemClock::time_point time) = 0;
/// Post caller owned |task| to be run immediately then rerun at a regular
/// |interval|.
- virtual void SchedulePeriodicTask(Task& task,
- chrono::SystemClock::duration interval) = 0;
- /// Post caller owned |task| to be run at |start_time| then rerun at a regular
+ virtual void PostPeriodic(Task& task,
+ chrono::SystemClock::duration interval) = 0;
+ /// Post caller owned |task| to be run at |time| then rerun at a regular
/// |interval|. |interval| must not be zero.
- virtual void SchedulePeriodicTask(
- Task& task,
- chrono::SystemClock::duration interval,
- chrono::SystemClock::time_point start_time) = 0;
+ virtual void PostPeriodicAt(Task& task,
+ chrono::SystemClock::duration interval,
+ chrono::SystemClock::time_point time) = 0;
/// Returns true if |task| is succesfully canceled.
/// If cancelation fails, the task may be running or completed.
diff --git a/pw_async/public/pw_async/fake_dispatcher.h b/pw_async/public/pw_async/fake_dispatcher.h
index 6bc8a039d..6a7e5ab31 100644
--- a/pw_async/public/pw_async/fake_dispatcher.h
+++ b/pw_async/public/pw_async/fake_dispatcher.h
@@ -35,33 +35,30 @@ class FakeDispatcher final : public Dispatcher {
void RequestStop() override { native_dispatcher_.RequestStop(); }
// Post caller owned |task|.
- void PostTask(Task& task) override { native_dispatcher_.PostTask(task); }
+ void Post(Task& task) override { native_dispatcher_.Post(task); }
// Post caller owned |task| to be run after |delay|.
- void PostDelayedTask(Task& task,
- chrono::SystemClock::duration delay) override {
- native_dispatcher_.PostDelayedTask(task, delay);
+ void PostAfter(Task& task, chrono::SystemClock::duration delay) override {
+ native_dispatcher_.PostAfter(task, delay);
}
// Post caller owned |task| to be run at |time|.
- void PostTaskForTime(Task& task,
- chrono::SystemClock::time_point time) override {
- native_dispatcher_.PostTaskForTime(task, time);
+ void PostAt(Task& task, chrono::SystemClock::time_point time) override {
+ native_dispatcher_.PostAt(task, time);
}
// Post caller owned |task| to be run immediately then rerun at a regular
// |interval|.
- void SchedulePeriodicTask(Task& task,
- chrono::SystemClock::duration interval) override {
- native_dispatcher_.SchedulePeriodicTask(task, interval);
+ void PostPeriodic(Task& task,
+ chrono::SystemClock::duration interval) override {
+ native_dispatcher_.PostPeriodic(task, interval);
}
// Post caller owned |task| to be run at |start_time| then rerun at a regular
// |interval|.
- void SchedulePeriodicTask(
- Task& task,
- chrono::SystemClock::duration interval,
- chrono::SystemClock::time_point start_time) override {
- native_dispatcher_.SchedulePeriodicTask(task, interval, start_time);
+ void PostPeriodicAt(Task& task,
+ chrono::SystemClock::duration interval,
+ chrono::SystemClock::time_point start_time) override {
+ native_dispatcher_.PostPeriodicAt(task, interval, start_time);
}
// Returns true if |task| is succesfully canceled.
diff --git a/pw_async_basic/dispatcher.cc b/pw_async_basic/dispatcher.cc
index 39686d069..682ff4f6d 100644
--- a/pw_async_basic/dispatcher.cc
+++ b/pw_async_basic/dispatcher.cc
@@ -120,33 +120,32 @@ void BasicDispatcher::DrainTaskQueue() {
}
}
-void BasicDispatcher::PostTask(Task& task) { PostTaskForTime(task, now()); }
+void BasicDispatcher::Post(Task& task) { PostAt(task, now()); }
-void BasicDispatcher::PostDelayedTask(Task& task,
- chrono::SystemClock::duration delay) {
- PostTaskForTime(task, now() + delay);
+void BasicDispatcher::PostAfter(Task& task,
+ chrono::SystemClock::duration delay) {
+ PostAt(task, now() + delay);
}
-void BasicDispatcher::PostTaskForTime(Task& task,
- chrono::SystemClock::time_point time) {
+void BasicDispatcher::PostAt(Task& task, chrono::SystemClock::time_point time) {
lock_.lock();
PW_LOG_DEBUG("posting task");
PostTaskInternal(task.native_type(), time);
lock_.unlock();
}
-void BasicDispatcher::SchedulePeriodicTask(
- Task& task, chrono::SystemClock::duration interval) {
- SchedulePeriodicTask(task, interval, now());
+void BasicDispatcher::PostPeriodic(Task& task,
+ chrono::SystemClock::duration interval) {
+ PostPeriodicAt(task, interval, now());
}
-void BasicDispatcher::SchedulePeriodicTask(
+void BasicDispatcher::PostPeriodicAt(
Task& task,
chrono::SystemClock::duration interval,
chrono::SystemClock::time_point start_time) {
PW_DCHECK(interval != chrono::SystemClock::duration::zero());
task.native_type().set_interval(interval);
- PostTaskForTime(task, start_time);
+ PostAt(task, start_time);
}
bool BasicDispatcher::Cancel(Task& task) {
diff --git a/pw_async_basic/dispatcher_test.cc b/pw_async_basic/dispatcher_test.cc
index 43d1cc1ee..77bfa025c 100644
--- a/pw_async_basic/dispatcher_test.cc
+++ b/pw_async_basic/dispatcher_test.cc
@@ -45,17 +45,17 @@ TEST(DispatcherBasic, PostTasks) {
};
Task task(inc_count);
- dispatcher.PostTask(task);
+ dispatcher.Post(task);
Task task2(inc_count);
- dispatcher.PostTask(task2);
+ dispatcher.Post(task2);
Task task3([&tp]([[maybe_unused]] Context& c, Status status) {
ASSERT_OK(status);
++tp.count;
tp.notification.release();
});
- dispatcher.PostTask(task3);
+ dispatcher.Post(task3);
tp.notification.acquire();
dispatcher.RequestStop();
@@ -82,14 +82,14 @@ TEST(DispatcherBasic, ChainedTasks) {
Task task2([&task1](Context& c, Status status) {
ASSERT_OK(status);
- c.dispatcher->PostTask(task1);
+ c.dispatcher->Post(task1);
});
Task task3([&task2](Context& c, Status status) {
ASSERT_OK(status);
- c.dispatcher->PostTask(task2);
+ c.dispatcher->Post(task2);
});
- dispatcher.PostTask(task3);
+ dispatcher.Post(task3);
notification.acquire();
dispatcher.RequestStop();
@@ -109,15 +109,15 @@ TEST(DispatcherBasic, RequestStopInsideTask) {
// These tasks are never executed and cleaned up in RequestStop().
Task task0(inc_count), task1(inc_count);
- dispatcher.PostDelayedTask(task0, 20ms);
- dispatcher.PostDelayedTask(task1, 21ms);
+ dispatcher.PostAfter(task0, 20ms);
+ dispatcher.PostAfter(task1, 21ms);
Task stop_task([&count]([[maybe_unused]] Context& c, Status status) {
ASSERT_OK(status);
++count;
c.dispatcher->RequestStop();
});
- dispatcher.PostTask(stop_task);
+ dispatcher.Post(stop_task);
work_thread.join();
ASSERT_EQ(count, 3);
@@ -134,9 +134,9 @@ TEST(DispatcherBasic, TasksCancelledByRequestStopInDifferentThread) {
};
Task task0(inc_count), task1(inc_count), task2(inc_count);
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
dispatcher.RequestStop();
work_thread.join();
@@ -153,9 +153,9 @@ TEST(DispatcherBasic, TasksCancelledByDispatcherDestructor) {
{
BasicDispatcher dispatcher;
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
}
ASSERT_EQ(count, 3);
@@ -170,9 +170,9 @@ TEST(DispatcherBasic, TasksCancelledByRunUntilIdle) {
Task task0(inc_count), task1(inc_count), task2(inc_count);
BasicDispatcher dispatcher;
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
dispatcher.RequestStop();
dispatcher.RunUntilIdle();
@@ -188,9 +188,9 @@ TEST(DispatcherBasic, TasksCancelledByRunFor) {
Task task0(inc_count), task1(inc_count), task2(inc_count);
BasicDispatcher dispatcher;
- dispatcher.PostDelayedTask(task0, 10s);
- dispatcher.PostDelayedTask(task1, 10s);
- dispatcher.PostDelayedTask(task2, 10s);
+ dispatcher.PostAfter(task0, 10s);
+ dispatcher.PostAfter(task1, 10s);
+ dispatcher.PostAfter(task2, 10s);
dispatcher.RequestStop();
dispatcher.RunFor(5s);
diff --git a/pw_async_basic/docs.rst b/pw_async_basic/docs.rst
index fcf26a9ce..eed19c9a9 100644
--- a/pw_async_basic/docs.rst
+++ b/pw_async_basic/docs.rst
@@ -36,7 +36,7 @@ Next, construct and use a ``BasicDispatcher``.
#include "pw_async_basic/dispatcher.h"
void DelayedPrint(pw::async::Dispatcher& dispatcher) {
- dispatcher.PostDelayedTask([](auto&){
+ dispatcher.PostAfter([](auto&){
printf("hello world\n");
}, 5s);
}
diff --git a/pw_async_basic/fake_dispatcher.cc b/pw_async_basic/fake_dispatcher.cc
index a4c65e751..cbba89e98 100644
--- a/pw_async_basic/fake_dispatcher.cc
+++ b/pw_async_basic/fake_dispatcher.cc
@@ -88,32 +88,30 @@ void NativeFakeDispatcher::DrainTaskQueue() {
}
}
-void NativeFakeDispatcher::PostTask(Task& task) {
- PostTaskForTime(task, now());
-}
+void NativeFakeDispatcher::Post(Task& task) { PostAt(task, now()); }
-void NativeFakeDispatcher::PostDelayedTask(
- Task& task, chrono::SystemClock::duration delay) {
- PostTaskForTime(task, now() + delay);
+void NativeFakeDispatcher::PostAfter(Task& task,
+ chrono::SystemClock::duration delay) {
+ PostAt(task, now() + delay);
}
-void NativeFakeDispatcher::PostTaskForTime(
- Task& task, chrono::SystemClock::time_point time) {
+void NativeFakeDispatcher::PostAt(Task& task,
+ chrono::SystemClock::time_point time) {
PW_LOG_DEBUG("posting task");
PostTaskInternal(task.native_type(), time);
}
-void NativeFakeDispatcher::SchedulePeriodicTask(
+void NativeFakeDispatcher::PostPeriodic(
Task& task, chrono::SystemClock::duration interval) {
- SchedulePeriodicTask(task, interval, now());
+ PostPeriodicAt(task, interval, now());
}
-void NativeFakeDispatcher::SchedulePeriodicTask(
+void NativeFakeDispatcher::PostPeriodicAt(
Task& task,
chrono::SystemClock::duration interval,
chrono::SystemClock::time_point start_time) {
task.native_type().set_interval(interval);
- PostTaskForTime(task, start_time);
+ PostAt(task, start_time);
}
bool NativeFakeDispatcher::Cancel(Task& task) {
diff --git a/pw_async_basic/fake_dispatcher_fixture_test.cc b/pw_async_basic/fake_dispatcher_fixture_test.cc
index e7835bd96..5262c3438 100644
--- a/pw_async_basic/fake_dispatcher_fixture_test.cc
+++ b/pw_async_basic/fake_dispatcher_fixture_test.cc
@@ -25,7 +25,7 @@ TEST_F(FakeDispatcherFixture, PostTasks) {
auto inc_count = [&count](Context& /*c*/, Status /*status*/) { ++count; };
Task task(inc_count);
- dispatcher().PostTask(task);
+ dispatcher().Post(task);
ASSERT_EQ(count, 0);
RunUntilIdle();
diff --git a/pw_async_basic/public/pw_async_basic/dispatcher.h b/pw_async_basic/public/pw_async_basic/dispatcher.h
index 0eefa45b8..2a198bd89 100644
--- a/pw_async_basic/public/pw_async_basic/dispatcher.h
+++ b/pw_async_basic/public/pw_async_basic/dispatcher.h
@@ -29,17 +29,14 @@ class BasicDispatcher final : public Dispatcher, public thread::ThreadCore {
// Dispatcher overrides:
void RequestStop() override PW_LOCKS_EXCLUDED(lock_);
- void PostTask(Task& task) override;
- void PostDelayedTask(Task& task,
- chrono::SystemClock::duration delay) override;
- void PostTaskForTime(Task& task,
- chrono::SystemClock::time_point time) override;
- void SchedulePeriodicTask(Task& task,
- chrono::SystemClock::duration interval) override;
- void SchedulePeriodicTask(
- Task& task,
- chrono::SystemClock::duration interval,
- chrono::SystemClock::time_point start_time) override;
+ void Post(Task& task) override;
+ void PostAfter(Task& task, chrono::SystemClock::duration delay) override;
+ void PostAt(Task& task, chrono::SystemClock::time_point time) override;
+ void PostPeriodic(Task& task,
+ chrono::SystemClock::duration interval) override;
+ void PostPeriodicAt(Task& task,
+ chrono::SystemClock::duration interval,
+ chrono::SystemClock::time_point start_time) override;
bool Cancel(Task& task) override PW_LOCKS_EXCLUDED(lock_);
void RunUntilIdle() override;
void RunUntil(chrono::SystemClock::time_point end_time) override;
diff --git a/pw_async_basic/public/pw_async_basic/fake_dispatcher.h b/pw_async_basic/public/pw_async_basic/fake_dispatcher.h
index f4ce9a529..96fd7aae8 100644
--- a/pw_async_basic/public/pw_async_basic/fake_dispatcher.h
+++ b/pw_async_basic/public/pw_async_basic/fake_dispatcher.h
@@ -26,16 +26,16 @@ class NativeFakeDispatcher final {
void RequestStop();
- void PostTask(Task& task);
+ void Post(Task& task);
- void PostDelayedTask(Task& task, chrono::SystemClock::duration delay);
+ void PostAfter(Task& task, chrono::SystemClock::duration delay);
- void PostTaskForTime(Task& task, chrono::SystemClock::time_point time);
+ void PostAt(Task& task, chrono::SystemClock::time_point time);
- void SchedulePeriodicTask(Task& task, chrono::SystemClock::duration interval);
- void SchedulePeriodicTask(Task& task,
- chrono::SystemClock::duration interval,
- chrono::SystemClock::time_point start_time);
+ void PostPeriodic(Task& task, chrono::SystemClock::duration interval);
+ void PostPeriodicAt(Task& task,
+ chrono::SystemClock::duration interval,
+ chrono::SystemClock::time_point start_time);
bool Cancel(Task& task);
diff --git a/pw_async_basic/size_report/post_1_task.cc b/pw_async_basic/size_report/post_1_task.cc
index f2e4da470..ef6065b1c 100644
--- a/pw_async_basic/size_report/post_1_task.cc
+++ b/pw_async_basic/size_report/post_1_task.cc
@@ -21,7 +21,7 @@ int main() {
pw::async::BasicDispatcher dispatcher;
pw::async::Task task(
[](pw::async::Context& /*ctx*/) { printf("hello world\n"); });
- dispatcher.PostTask(task);
+ dispatcher.Post(task);
dispatcher.Run();
return 0;
}