Nursery: Capture onSettledCb before fillSlot in launch()

This commit is contained in:
2026-06-09 10:55:33 -04:00
parent 5689ac3914
commit 656aae37c8
2 changed files with 22 additions and 18 deletions
+7 -1
View File
@@ -343,10 +343,16 @@ public:
}
template <class InvokerFactory>
Slot::Handle launch(InvokerFactory &&factory)
Slot::Handle launch(
InvokerFactory &&factory,
std::function<void(std::exception_ptr &exceptionPtr)> onSettledHook =
nullptr)
{
auto lease = getNewSlotLease();
lease.getSyncCanceler().startAcceptingWork();
if (onSettledHook) {
lease.setOnSettledHook(std::move(onSettledHook));
}
lease.fillSlot(
[&factory, &lease]()
{