mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-05 15:03:07 +00:00
Add limitation doc
This commit is contained in:
parent
24359d409e
commit
56dc449096
@ -91,6 +91,10 @@ Run the example:
|
||||
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:
|
||||
|
||||
### Limitation
|
||||
|
||||
Callbacks must be fast and non-blocking; otherwise, the working thread will hang and prevent other requests from being processed.
|
||||
|
||||
```bash
|
||||
# Build dynamic (default)
|
||||
make libcodex
|
||||
|
||||
@ -40,6 +40,12 @@ proc createShared*(
|
||||
ret[].userData = userData
|
||||
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](
|
||||
res: Result[T, string], request: ptr CodexThreadRequest
|
||||
) =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user