mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-08 16:33:11 +00:00
Add limitation doc
This commit is contained in:
parent
03dc036311
commit
f6743d3ccb
@ -91,6 +91,10 @@ Run the example:
|
|||||||
By default, Codex builds a dynamic library (`libcodex.so`), which you can load at runtime.
|
By default, Codex builds a dynamic library (`libcodex.so`), which you can load at runtime.
|
||||||
If you prefer a static library (`libcodex.a`), set the `STATIC` flag:
|
If you prefer a static library (`libcodex.a`), set the `STATIC` flag:
|
||||||
|
|
||||||
|
### Limitation
|
||||||
|
|
||||||
|
Callbacks must be fast and non-blocking; otherwise, the working thread will hang and prevent other requests from being processed.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build dynamic (default)
|
# Build dynamic (default)
|
||||||
make libcodex
|
make libcodex
|
||||||
|
|||||||
@ -40,6 +40,12 @@ proc createShared*(
|
|||||||
ret[].userData = userData
|
ret[].userData = userData
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
# NOTE: User callbacks are executed on the working thread.
|
||||||
|
# They must be fast and non-blocking; otherwise this thread will be blocked
|
||||||
|
# and no further requests can be processed.
|
||||||
|
# We can improve this by dispatching the callbacks to a thread pool or
|
||||||
|
# moving to a MP channel.
|
||||||
|
# See: https://github.com/codex-storage/nim-codex/pull/1322#discussion_r2340708316
|
||||||
proc handleRes[T: string | void](
|
proc handleRes[T: string | void](
|
||||||
res: Result[T, string], request: ptr CodexThreadRequest
|
res: Result[T, string], request: ptr CodexThreadRequest
|
||||||
) =
|
) =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user