From d2b777607ae05542a3294e8c019f5c7b046f910c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 15 Mar 2020 09:02:49 +0100 Subject: [PATCH] Use normal task priority when handling events. Defining VibeHighEventPriority to revers to the old event scheduling priority. --- source/vibe/internal/async.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/vibe/internal/async.d b/source/vibe/internal/async.d index 0712dce..48ec7be 100644 --- a/source/vibe/internal/async.d +++ b/source/vibe/internal/async.d @@ -3,7 +3,7 @@ module vibe.internal.async; import std.traits : ParameterTypeTuple, ReturnType; import std.typecons : tuple; import vibe.core.core : hibernate, switchToTask; -import vibe.core.task : InterruptException, Task; +import vibe.core.task : InterruptException, Task, TaskSwitchPriority; import vibe.core.log; import core.time : Duration, seconds; @@ -131,7 +131,10 @@ void asyncAwaitAny(bool interruptible, Waitables...)(string func = __FUNCTION__) fired[%1$s] = true; any_fired = true; Waitables[%1$s].done(%3$s); - if (t != Task.init) switchToTask(t); + if (t != Task.init) { + version (VibeHighEventPriority) switchToTask(t); + else switchToTask(t, TaskSwitchPriority.normal); + } }; debug(VibeAsyncLog) logDebugV("Starting operation %%s", %1$s);