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

View File

@ -1,11 +1,20 @@
import ./types
import chronos
import results
import chronos/threadsync
export types
type
AsyncQueue*[T] = object
signal: ThreadSignalPtr
item*: T
proc new*[T](tp: typedesc[AsyncQueue[T]]): AsyncQueue[T] {.raises: [ApatheiaException].} =
let res = ThreadSignalPtr.new()
if res.isErr():
raise newException(ApatheiaException, msg: res.err())

3
src/apatheia/types.nim Normal file
View File

@ -0,0 +1,3 @@
type
ApatheiaException* = ref object of CatchableError