more cleanup

This commit is contained in:
Jaremy Creechley 2023-08-25 15:21:12 -07:00
parent a27102675e
commit 216a5ea518
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 5 additions and 12 deletions

View File

@ -59,7 +59,7 @@ method get*(
echo "closing signal"
ret[].signal.close()
echo "\nSharedDataStore:put:value: ", ret[].repr
print "\nSharedDataStore:put:value: ", ret[]
let data = ret[].value.toSeq(byte)
return success(data)
@ -117,8 +117,8 @@ proc newSharedDataStore*(
echo "closing signal"
res[].signal.close()
echo "\nnewSharedDataStore:state: ", res[].state.repr
echo "\nnewSharedDataStore:value: ", res[].value[].backend.repr
print "\nnewSharedDataStore:state: ", res[].state
print "\nnewSharedDataStore:value: ", res[].value[].backend
self.tds = res[].value

View File

@ -80,15 +80,11 @@ proc newThreadResult*[T](tp: typedesc[T]): Result[TResult[T], ref CatchableError
proc startupDatastore(
ret: TResult[ThreadDatastorePtr],
backend: ThreadBackend,
count: TestPtr,
) {.raises: [].} =
## starts up a FS instance on a give thread
echo "\n"
echo "\nstartupDatastore: threadId:", getThreadId()
echo "\nstartupDatastore: ret:\n", ret.repr
echo "\nstartupDatastore: backend:\n", backend.repr
echo "\nstartupDatastore: count:\n", count.repr
print "\nstartupDatastore: backend:\n", backend
echo ""
case backend.kind:
@ -177,10 +173,7 @@ proc createThreadDatastore*(
try:
echo "createThreadDatastore: start"
ret[].value[].tp = Taskpool.new(num_threads = 2)
# echo "\n\ncreateThreadDatastore:tp:\n", ret[].repr
echo "\n\ncreateThreadDatastore:value:\n", ret[].value.repr
ret[].value[].tp.spawn startupDatastore(
ret, backend, newSharedPtr(Test(count: FSBackend)))
ret[].value[].tp.spawn startupDatastore(ret, backend)
echo "createThreadDatastore: done"
ret[].state = Success