arquero-worker
v0.0.2
Published
Worker thread support for Arquero.
Downloads
5
Maintainers
Readme
arquero-worker
A proof-of-concept implementation of worker thread support for Arquero queries. Forks a worker thread using either a Web Worker or a node.js Worker thread and provides an API for authoring queries, submitting queries to the worker for processing, and fetching the query results.
Example
// create query worker, providing web worker script
const qw = aq.worker('./arquero-worker.min.js');
// load dataset into worker thread
// return value is a query builder with a table verb API
const beers = await qw.load('beers', 'data/beers.csv');
// build a query for beers with the word 'hop' in their name
// fetch the data, query is processed on worker thread
const hops = await beers
.filter(d => op.match(d.name, /hop/i))
.select('name', 'abv', 'ibu')
.orderby('name')
.fetch();
// print the fetched rows to the console
hops.print();
For more, see the example page and its source code.
Build Instructions
To build and develop arquero-query locally:
- Clone https://github.com/uwdata/arquero-worker.
- Run
yarn
to install dependencies for all packages. If you don't have yarn installed, see https://yarnpkg.com/en/docs/install. - Run
yarn test
to run test cases, andyarn build
to build output files.