first impl of batch ops

This commit is contained in:
Jaremy Creechley 2023-08-29 13:08:55 -07:00 committed by Dmitriy Ryajov
parent c21532b731
commit 11267c842f
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4

View File

@ -65,6 +65,11 @@ method delete*(
self: ThreadProxyDatastore,
keys: seq[Key]
): Future[?!void] {.async.} =
for key in keys:
if err =? (await self.delete(key)).errorOption:
return failure err
return success()
method get*(
@ -110,7 +115,12 @@ method put*(
self: ThreadProxyDatastore,
batch: seq[BatchEntry]
): Future[?!void] {.async.} =
raiseAssert("Not implemented!")
for entry in batch:
if err =? (await self.put(entry.key, entry.data)).errorOption:
return failure err
return success()
method close*(
self: ThreadProxyDatastore