
@magmacomputing/tempo-plugin-batch
This is a Community plugin for the Tempo library that parallelizes massive epoch mutation tasks across worker threads utilizing lock-free SharedArrayBuffer architecture for extreme throughput.
👉 View the full documentation on our GitHub Pages
Perfect for: Heavy data ETL pipelines, massive IoT telemetry ingestion, financial ledger chronometrics, and any parallel bulk date-processing workloads.
Installation
npm install @magmacomputing/tempo-plugin-batch
Usage
import { Tempo } from '@magmacomputing/tempo';
import { BatchPlugin } from '@magmacomputing/tempo-plugin-batch';
Tempo.init({
extends: [BatchPlugin]
});
const epochs = [1700000000000, 1700000001000, ];
const batchResult = await Tempo.batch(epochs, { weeks: 1 });
console.log(batchResult);
Rehydration
By default, Tempo.batch returns an array of primitive number timestamps to maximize throughput over the thread boundary. If you need fully-fledged Tempo objects back, pass { rehydrate: true }:
const tempoInstances = await Tempo.batch(epochs, { weeks: 1 }, { rehydrate: true });
Graceful Degradation
If the host environment does not support SharedArrayBuffer (or if it is blocked by CORS/COOP headers in the browser), the orchestrator intelligently and transparently falls back to using traditional postMessage structural cloning chunks to ensure execution never halts.
Licensing
This is a Community plugin. It is completely free and open-source for personal and commercial use under the MIT license.