Skip to content

Commit

Permalink
use the recommended way to load a worker
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Nov 5, 2024
1 parent 5afd2db commit 4069984
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/components/src/workers/parquetWorkerClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { asyncBufferFromUrl, cachedAsyncBuffer, AsyncBuffer, ParquetReadOptions, FileMetaData } from 'hyparquet'
import ParquetWorker from './parquetWorker?worker'

// Serializable constructor for AsyncBuffers
export interface AsyncBufferFrom {
Expand All @@ -25,7 +24,7 @@ const pending = new Map<number, QueryAgent>()

function getWorker() {
if (!worker) {
worker = new ParquetWorker() //new URL('./parquetWorker', import.meta.url), { type: 'module' })
worker = new Worker(new URL('./parquetWorker', import.meta.url), { type: 'module' })
worker.onmessage = ({ data }) => {
const { resolve, reject, onChunk } = pending.get(data.queryId)!
if (data.error) {
Expand Down

0 comments on commit 4069984

Please sign in to comment.