mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-05 22:43:10 +00:00
docs
This commit is contained in:
parent
9a74fea86a
commit
b7ddb871fe
@ -21,12 +21,13 @@ type
|
|||||||
signal: ThreadSignalPtr
|
signal: ThreadSignalPtr
|
||||||
chan*: ChanPtr[T]
|
chan*: ChanPtr[T]
|
||||||
|
|
||||||
proc destroy*[T](val: SignalQueue[T]) =
|
proc dispose*[T](val: SignalQueue[T]) =
|
||||||
|
## Call to properly dispose of a SignalQueue.
|
||||||
deallocShared(val.chan)
|
deallocShared(val.chan)
|
||||||
discard val.signal.close()
|
discard val.signal.close()
|
||||||
|
|
||||||
proc newSignalQueue*[T](maxItems: int = 0): SignalQueue[T] {.raises: [ApatheiaSignalErr].} =
|
proc newSignalQueue*[T](maxItems: int = 0): SignalQueue[T] {.raises: [ApatheiaSignalErr].} =
|
||||||
## Create a signal queue compatible with Chronos async
|
## Create a signal queue compatible with Chronos async.
|
||||||
let res = ThreadSignalPtr.new()
|
let res = ThreadSignalPtr.new()
|
||||||
if res.isErr():
|
if res.isErr():
|
||||||
raise newException(ApatheiaSignalErr, res.error())
|
raise newException(ApatheiaSignalErr, res.error())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user