🐛 fix(async_executor): implement cooperative cancellation
This commit is contained in:
@@ -49,7 +49,7 @@ namespace lsp::test::provider
|
||||
|
||||
struct ProviderEnv
|
||||
{
|
||||
scheduler::AsyncExecutor scheduler{ 1 };
|
||||
scheduler::async_executor::AsyncExecutor scheduler{ 1 };
|
||||
manager::ManagerHub hub{};
|
||||
core::RequestDispatcher dispatcher{};
|
||||
|
||||
@@ -1225,7 +1225,7 @@ namespace lsp::test::provider
|
||||
auto code_action_tree = env.hub.parser().GetTree(code_action_uri);
|
||||
auto code_action_diagnostics = BuildDiagnosticsFromSyntaxErrors(code_action_tree, code_action_content);
|
||||
|
||||
env.scheduler.Submit("json_cancel_me", []() -> std::optional<std::string> {
|
||||
env.scheduler.Submit("json_cancel_me", [](std::stop_token) -> std::optional<std::string> {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
return std::string("done");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user