diff options
author | Inteon <42113979+inteon@users.noreply.github.com> | 2021-03-18 14:10:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 14:10:27 +0100 |
commit | 20627c91364d2a992fdfaaad7c8ae86454dbc2ed (patch) | |
tree | acef1a279e92fe072da2cce2178889f6124c47c7 /core/core.js | |
parent | 0e70d9e59bc0e70f1921bb217ee00fc2e6facb69 (diff) |
refactor: update minimal ops & rename to buffer ops (#9719)
This commit rewrites "dispatch_minimal" into "dispatch_buffer".
It's part of an effort to unify JS interface for ops for both json
and minimal (buffer) ops.
Before this commit "minimal ops" could be either sync or async
depending on the return type from the op, but this commit changes
it to have separate signatures for sync and async ops (just like
in case of json ops).
Diffstat (limited to 'core/core.js')
-rw-r--r-- | core/core.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/core.js b/core/core.js index fead23907..f44bf253e 100644 --- a/core/core.js +++ b/core/core.js @@ -155,6 +155,10 @@ SharedQueue Binary Layout asyncHandlers[opId] = cb; } + function setAsyncHandlerByName(opName, cb) { + setAsyncHandler(opsCache[opName], cb); + } + function handleAsyncMsgFromRust() { while (true) { const opIdBuf = shift(); @@ -256,6 +260,7 @@ SharedQueue Binary Layout jsonOpAsync, jsonOpSync, setAsyncHandler, + setAsyncHandlerByName, dispatch: send, dispatchByName: dispatch, ops, |