I have a function like so:
pub async fn tile(&self, z: u8, x: u32, y: u32) -> Result<Buffer> {
tokio::task::spawn(async move {
let t = Tile::from_zxy(z, x, y);
let buf = tile_info(t).into();
Ok(buf)
}).await.unwrap()
}
However, whenever I call it from an Electron app, with sandboxing turned off, I still get the following error:
[31872:1015/170858.344491:ERROR:node_bindings.cc(146)] Fatal error in V8: v8_ArrayBuffer_NewBackingStore When the V8 Sandbox is enabled, ArrayBuffer backing stores must be allocated inside the sandbox address space. Please use an appropriate ArrayBuffer::Allocator to allocate these buffers.
I want to essentially have a Vec<u8 / Uint8Array of data created in a tokio task, and I want to access that data in NodeJS. Am I doing this wrong, or is there a bug here?
Is there a way to tell v8 to allocate a buffer, and do it from within a tokio task?
I have a function like so:
However, whenever I call it from an Electron app, with sandboxing turned off, I still get the following error:
I want to essentially have a
Vec<u8/Uint8Arrayof data created in a tokio task, and I want to access that data in NodeJS. Am I doing this wrong, or is there a bug here?Is there a way to tell v8 to allocate a buffer, and do it from within a tokio task?