From 9860f359d05c4a15e52dc33dbbf5aa96639c2295 Mon Sep 17 00:00:00 2001 From: Viraj Mehta Date: Sat, 27 Dec 2025 10:41:23 -0500 Subject: [PATCH] added a public API for spawning unchecked tasks --- src/client.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/client.rs b/src/client.rs index 84042b9..7d22472 100644 --- a/src/client.rs +++ b/src/client.rs @@ -414,6 +414,38 @@ where .await } + /// Spawn a task by name WITHOUT registry validation. + /// + /// Use this when you know the task will be registered on the worker, + /// but the spawning client doesn't have the task registered locally. + pub async fn spawn_by_name_unchecked( + &self, + task_name: &str, + params: JsonValue, + options: SpawnOptions, + ) -> DurableResult { + self.spawn_by_name_internal(&self.pool, task_name, params, options) + .await + } + + /// Spawn a task by name using a custom executor WITHOUT registry validation. + /// + /// Use this when you know the task will be registered on the worker, + /// but the spawning client doesn't have the task registered locally. + pub async fn spawn_by_name_unchecked_with<'e, E>( + &self, + executor: E, + task_name: &str, + params: JsonValue, + options: SpawnOptions, + ) -> DurableResult + where + E: Executor<'e, Database = Postgres>, + { + self.spawn_by_name_internal(executor, task_name, params, options) + .await + } + /// Internal spawn implementation without registry validation. #[allow(unused_mut)] // mut is needed when telemetry feature is enabled async fn spawn_by_name_internal<'e, E>(