@yuuang/ffi-rs-darwin-x64
Advanced tools
Comparing version 1.0.64 to 1.0.65
{ | ||
"name": "@yuuang/ffi-rs-darwin-x64", | ||
"version": "1.0.64", | ||
"version": "1.0.65", | ||
"os": [ | ||
@@ -5,0 +5,0 @@ "darwin" |
@@ -26,2 +26,3 @@ # ffi-rs | ||
- Provide many ways to handle pointer type directly 🐮 | ||
- Support run ffi task [in a new thread](#runInNewThread) 🤩️ | ||
- Support output [errno](#errno) info 🤔️ | ||
@@ -685,1 +686,23 @@ | ||
``` | ||
## runInNewThread | ||
`ffi-rs` support run ffi task in a new thread without blocking the main thread which is useful for cpu intensive task. | ||
To use the feature, you can pass `runInNewThread` option to load method | ||
```js | ||
const testRunInNewThread = async () => { | ||
// will return a promise but the task will run in a new thread | ||
load({ | ||
library: "libsum", | ||
funcName: "sum", | ||
retType: DataType.I32, | ||
paramsType: [DataType.I32, DataType.I32], | ||
paramsValue: [1, 2], | ||
runInNewThread: true, | ||
}).then(res => { | ||
equal(res, 3) | ||
}) | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
621357
707