mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-04 05:53:11 +00:00
docs
This commit is contained in:
parent
ede73f9463
commit
f68c3c176d
@ -15,13 +15,17 @@ template checkParamType*(obj: typed): auto =
|
|||||||
obj
|
obj
|
||||||
|
|
||||||
macro asyncTask*(p: untyped): untyped =
|
macro asyncTask*(p: untyped): untyped =
|
||||||
|
## Pragma to transfer a proc into a "tasklet" which runs
|
||||||
|
## the proc body in a separate thread and returns the result
|
||||||
|
## in an async compatible manner.
|
||||||
|
##
|
||||||
|
|
||||||
let
|
let
|
||||||
procId = p[0]
|
procId = p[0]
|
||||||
procLineInfo = p.lineInfoObj
|
# procLineInfo = p.lineInfoObj
|
||||||
genericParams = p[2]
|
# genericParams = p[2]
|
||||||
params = p[3]
|
params = p[3]
|
||||||
pragmas = p[4]
|
# pragmas = p[4]
|
||||||
body = p[6]
|
body = p[6]
|
||||||
name = repr(procId).strip(false, true, {'*'})
|
name = repr(procId).strip(false, true, {'*'})
|
||||||
|
|
||||||
@ -67,7 +71,7 @@ when isMainModule:
|
|||||||
striped*: bool
|
striped*: bool
|
||||||
|
|
||||||
proc doHashes2*(data: openArray[byte],
|
proc doHashes2*(data: openArray[byte],
|
||||||
opts: HashOptions): float {.asyncTask.} =
|
opts: HashOptions): float {.asyncTask.} =
|
||||||
echo "hashing"
|
echo "hashing"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user