mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Nursery: Capture onSettledCb before fillSlot in launch()
This commit is contained in:
@@ -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]()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user