From e666189efac03e2ffc8da07f57cd744f62f080c7 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Fri, 9 Feb 2024 18:26:50 -0700 Subject: [PATCH] queues --- src/apatheia/queues.nim | 11 +++++++++++ tests/tasyncsEx1.nim | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/apatheia/queues.nim diff --git a/src/apatheia/queues.nim b/src/apatheia/queues.nim new file mode 100644 index 0000000..f8e5ded --- /dev/null +++ b/src/apatheia/queues.nim @@ -0,0 +1,11 @@ + +import chronos +import chronos/threadsync + +type + + AsyncQueue*[T] = object + signal: ThreadSignalPtr + item*: T + + diff --git a/tests/tasyncsEx1.nim b/tests/tasyncsEx1.nim index 26abe64..4803d91 100644 --- a/tests/tasyncsEx1.nim +++ b/tests/tasyncsEx1.nim @@ -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!"