diff --git a/datastore/sharedds.nim b/datastore/sharedds.nim index 512836a..79cafb8 100644 --- a/datastore/sharedds.nim +++ b/datastore/sharedds.nim @@ -23,42 +23,24 @@ method has*( self: SharedDatastore, key: Key ): Future[?!bool] {.async.} = - - # without mounted =? self.dispatch(key): - # return failure "No mounted datastore found" - # return (await mounted.store.store.has(mounted.relative)) return success(true) method delete*( self: SharedDatastore, key: Key ): Future[?!void] {.async.} = - - # without mounted =? self.dispatch(key), error: - # return failure(error) - # return (await mounted.store.store.delete(mounted.relative)) return success() method delete*( self: SharedDatastore, keys: seq[Key] ): Future[?!void] {.async.} = - - # for key in keys: - # if err =? (await self.delete(key)).errorOption: - # return failure err - return success() method get*( self: SharedDatastore, key: Key ): Future[?!seq[byte]] {.async.} = - - # without mounted =? self.dispatch(key), error: - # return failure(error) - - # return await mounted.store.store.get(mounted.relative) return success(newSeq[byte]()) method put*( diff --git a/datastore/threadbackend.nim b/datastore/threadbackend.nim index 9e4d7f2..019d8b6 100644 --- a/datastore/threadbackend.nim +++ b/datastore/threadbackend.nim @@ -78,18 +78,18 @@ proc put*( proc close*( self: ThreadDatastore, signal: ThreadSignalPtr, -): Result[void, CatchableErrorBuffer] = +): TResult[void] = try: self[].tp.shutdown() return ok() except Exception as exc: - return err(exc.toBuffer()) + return TResult[void].new() func new*[S: ref Datastore]( T: typedesc[ThreadDatastore], signal: ThreadSignalPtr, backend: ThreadBackend, -): Result[ThreadDatastore, CatchableErrorBuffer] = +): TResult[ThreadDatastore] = var self = T() self.tp = Taskpool.new(num_threads = 1) ##\