This commit is contained in:
Jaremy Creechley 2023-08-29 13:00:01 -07:00
parent 0acffdf156
commit 856c0b380c
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -29,7 +29,19 @@ method has*(
self: ThreadProxyDatastore, self: ThreadProxyDatastore,
key: Key key: Key
): Future[?!bool] {.async.} = ): 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*( method delete*(
self: ThreadProxyDatastore, self: ThreadProxyDatastore,
@ -39,7 +51,6 @@ method delete*(
without ret =? newThreadResult(void), err: without ret =? newThreadResult(void), err:
return failure(err) return failure(err)
echo "res: ", ret
try: try:
delete(ret, self.tds, key) delete(ret, self.tds, key)
await wait(ret[].signal) await wait(ret[].signal)
@ -50,7 +61,6 @@ method delete*(
echo "\nSharedDataStore:put:value: ", ret[].repr echo "\nSharedDataStore:put:value: ", ret[].repr
return success() return success()
method delete*( method delete*(
self: ThreadProxyDatastore, self: ThreadProxyDatastore,
keys: seq[Key] keys: seq[Key]