mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-07 15:33:09 +00:00
queues
This commit is contained in:
parent
e666189efa
commit
0c10e88aa8
@ -1,11 +1,20 @@
|
|||||||
|
import ./types
|
||||||
|
|
||||||
import chronos
|
import chronos
|
||||||
|
import results
|
||||||
import chronos/threadsync
|
import chronos/threadsync
|
||||||
|
|
||||||
|
export types
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
AsyncQueue*[T] = object
|
AsyncQueue*[T] = object
|
||||||
signal: ThreadSignalPtr
|
signal: ThreadSignalPtr
|
||||||
item*: T
|
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