UNPKG

bakana

Version:

Backend for kana's single-cell analyses. This supports single or multiple samples, execution in Node.js or the browser, in-memory caching of results for iterative analyses, and serialization to/from file for redistribution.

13 lines (10 loc) 325 B
import * as workers from "worker_threads"; export function registerCallback(callback) { // Wrapping it in an extra 'data:' to mimic Web Workers. workers.parentPort.on("message", msg => callback({ data: msg })); return; } export function sendMessage(msg) { workers.parentPort.postMessage(msg); return; }