From 1aec1a460d58702030804fd33ede47f4debba424 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Tue, 26 Sep 2023 17:30:20 -0700 Subject: [PATCH] result types --- datastore/threads/threadproxyds.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datastore/threads/threadproxyds.nim b/datastore/threads/threadproxyds.nim index fb41fbe..695af78 100644 --- a/datastore/threads/threadproxyds.nim +++ b/datastore/threads/threadproxyds.nim @@ -136,6 +136,7 @@ template dispatchTask[T](self: ThreadDatastore, let ctx {.inject.} = newSharedPtr(TaskCtxObj[T](signal: signal)) dispatchTaskWrap[T](self, signal, blk) + proc hasTask[T, DB](ctx: TaskCtx[T], ds: DB, key: KeyId) {.gcsafe.} = ## run backend command executeTask(ctx): @@ -152,6 +153,7 @@ method has*(self: ThreadDatastore, self.tp.spawn hasTask(ctx, ds, key) return ctx[].res.toRes(v => v) + proc deleteTask[T, DB](ctx: TaskCtx[T], ds: DB; key: KeyId) {.gcsafe.} = ## run backend command @@ -208,6 +210,9 @@ method put*( for entry in batch: if err =? (await self.put(entry.key, entry.data)).errorOption: return failure err + + return success() + proc getTask[DB](ctx: TaskCtx[DataBuffer], ds: DB; key: KeyId) {.gcsafe, nimcall.} =