mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 13:03:11 +00:00
queues
This commit is contained in:
parent
e666189efa
commit
0c10e88aa8
@ -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
3
src/apatheia/types.nim
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
type
|
||||
ApatheiaException* = ref object of CatchableError
|
||||
Loading…
x
Reference in New Issue
Block a user