mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-11 01:53:09 +00:00
impl has
This commit is contained in:
parent
0acffdf156
commit
856c0b380c
@ -29,7 +29,19 @@ method has*(
|
||||
self: ThreadProxyDatastore,
|
||||
key: Key
|
||||
): Future[?!bool] {.async.} =
|
||||
return success(true)
|
||||
|
||||
without ret =? newThreadResult(bool), err:
|
||||
return failure(err)
|
||||
|
||||
try:
|
||||
has(ret, self.tds, key)
|
||||
await wait(ret[].signal)
|
||||
finally:
|
||||
echo "closing signal"
|
||||
ret[].signal.close()
|
||||
|
||||
echo "\nSharedDataStore:has:value: ", ret[].repr
|
||||
return success(ret[].value)
|
||||
|
||||
method delete*(
|
||||
self: ThreadProxyDatastore,
|
||||
@ -39,7 +51,6 @@ method delete*(
|
||||
without ret =? newThreadResult(void), err:
|
||||
return failure(err)
|
||||
|
||||
echo "res: ", ret
|
||||
try:
|
||||
delete(ret, self.tds, key)
|
||||
await wait(ret[].signal)
|
||||
@ -50,7 +61,6 @@ method delete*(
|
||||
echo "\nSharedDataStore:put:value: ", ret[].repr
|
||||
return success()
|
||||
|
||||
|
||||
method delete*(
|
||||
self: ThreadProxyDatastore,
|
||||
keys: seq[Key]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user