mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-02-21 23:48:15 +00:00
Update README.
This commit is contained in:
parent
edcc628b30
commit
3c7273d532
10
README.md
10
README.md
@ -16,10 +16,14 @@ Asyncdispatch hard fork.
|
||||
Such a number of different types creates big problems in the storage, processing and interaction between callbacks. Lack of ability to pass custom user data to
|
||||
callback also creates difficulties and inefficiency, to pass custom user-defined data you need to use closures (one more allocation).
|
||||
|
||||
To resolve this issue introduced unified callback type `CallbackFunc`, which is
|
||||
looks like `CallbackFunc* = proc (arg: pointer = nil) {.gcsafe.}`. Also one more type is introduced for callback storage is `AsyncCallback`.
|
||||
|
||||
To resolve this issue introduced unified callback type `CallbackFunc`, which is looks like
|
||||
```nim
|
||||
type
|
||||
CallbackFunc* = proc (arg: pointer = nil) {.gcsafe.}
|
||||
```
|
||||
Also one more type is introduced for callback storage is `AsyncCallback`.
|
||||
|
||||
```nim
|
||||
type
|
||||
AsyncCallback* = object
|
||||
function*: CallbackFunc
|
||||
|
Loading…
x
Reference in New Issue
Block a user