Skip to content

Commit 5251dba

Browse files
committed
fix worker
1 parent 13518d5 commit 5251dba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/hyparquet-demo/src/workers/parquetWorkerClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import ParquetWorker from './parquetWorker?worker&inline'
2+
/// ^ the worker is bundled with the main thread code (inline) which is easier for users to import
3+
/// (no need to copy the worker file to the right place)
14
import { ColumnData } from 'hyparquet'
25
import type { ParquetMessage, ParquetReadWorkerOptions, Row } from './types.d.ts'
36

@@ -12,7 +15,7 @@ const pending = new Map<number, QueryAgent>()
1215

1316
function getWorker() {
1417
if (!worker) {
15-
worker = new Worker(new URL('./parquetWorker', import.meta.url))
18+
worker = new ParquetWorker()
1619
worker.onmessage = ({ data }: { data: ParquetMessage }) => {
1720
const pendingQueryAgent = pending.get(data.queryId)
1821
if (!pendingQueryAgent) {

0 commit comments

Comments
 (0)