From 484b7f5c0d08d817746caa685ed9ac5583eb37fa Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 5 Dec 2023 09:12:12 +0100 Subject: [PATCH] Mark invoke under :clj conditional --- src/promesa/exec.cljc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/promesa/exec.cljc b/src/promesa/exec.cljc index 5ef3329..640f9ec 100644 --- a/src/promesa/exec.cljc +++ b/src/promesa/exec.cljc @@ -384,12 +384,13 @@ ([scheduler ms f] (pt/-schedule! (resolve-scheduler scheduler) ms f))) -(defn invoke! - "Invoke a function to be executed in the provided executor +#?(:clj + (defn invoke! + "Invoke a function to be executed in the provided executor or the default one, and waits for the result. Useful for using in virtual threads." - ([f] (pt/-await! (submit! f))) - ([executor f] (pt/-await! (submit! executor f)))) + ([f] (pt/-await! (submit! f))) + ([executor f] (pt/-await! (submit! executor f))))) (defn- rejected [v]