mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 13:03:11 +00:00
docs
This commit is contained in:
parent
ede73f9463
commit
f68c3c176d
@ -15,13 +15,17 @@ template checkParamType*(obj: typed): auto =
|
||||
obj
|
||||
|
||||
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
|
||||
procId = p[0]
|
||||
procLineInfo = p.lineInfoObj
|
||||
genericParams = p[2]
|
||||
# procLineInfo = p.lineInfoObj
|
||||
# genericParams = p[2]
|
||||
params = p[3]
|
||||
pragmas = p[4]
|
||||
# pragmas = p[4]
|
||||
body = p[6]
|
||||
name = repr(procId).strip(false, true, {'*'})
|
||||
|
||||
@ -67,7 +71,7 @@ when isMainModule:
|
||||
striped*: bool
|
||||
|
||||
proc doHashes2*(data: openArray[byte],
|
||||
opts: HashOptions): float {.asyncTask.} =
|
||||
opts: HashOptions): float {.asyncTask.} =
|
||||
echo "hashing"
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user