diff --git a/Source/Console/Commands/Commands.cpp b/Source/Console/Commands/Commands.cpp index cf8edbac..633ca722 100644 --- a/Source/Console/Commands/Commands.cpp +++ b/Source/Console/Commands/Commands.cpp @@ -104,7 +104,7 @@ namespace Aurora::Console::Commands } else if (workerId) { - Async::NewWorkFunction(workerId.value(), [=]() -> void + Async::DispatchOn(workerId.value(), [=]() -> void { callback->OnCommand(res.result); }); diff --git a/Source/IO/Net/AuNetWorker.hpp b/Source/IO/Net/AuNetWorker.hpp index 2301f097..4a2c5218 100644 --- a/Source/IO/Net/AuNetWorker.hpp +++ b/Source/IO/Net/AuNetWorker.hpp @@ -74,19 +74,17 @@ namespace Aurora::IO::Net auto old = this->callbacks_; auto temp = AuMakeShared>([=](const AuSPtr &response) { - auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_,[response, callbacks = old]() + (void)AuAsync::DispatchOn(this->origin_,[response, callbacks = old]() { callbacks->OnSuccess(response.get()); }); - SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically"); }, [=](const AuSPtr &response) { - auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_, [response, callbacks = old]() + (void)AuAsync::DispatchOn(this->origin_, [response, callbacks = old]() { callbacks->OnFailure(response.get()); }); - SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically"); }); if (!temp)