This commit is contained in:
Jaremy Creechley 2024-02-09 18:26:50 -07:00
parent b48d21966d
commit e666189efa
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 12 additions and 1 deletions

11
src/apatheia/queues.nim Normal file
View File

@ -0,0 +1,11 @@
import chronos
import chronos/threadsync
type
AsyncQueue*[T] = object
signal: ThreadSignalPtr
item*: T

View File

@ -16,7 +16,7 @@ type
proc addNums(a, b: float, ret: ptr ThreadArg) =
ret.value = a + b
os.sleep(1_000)
os.sleep(500)
let res = ret.doneSig.fireSync().get()
if not res:
echo "ERROR FIRING!"