async-task
async-task copied to clipboard
Dummy task
Ability to create an already completed Task
with something like Task::completed(...)
.
This would serve as a way to mock asynchronous functionality with synchronous code.
My specific use case is an interface which has to return a Task
, but the actual code doesn't have a way to create said Task
.
(I don't think this solution can be called sound, but it is what it is)
source
This is very much inspired by C#.