chore -cached loading (V3 omezarr support) step one#205
Conversation
| import { logger } from '@alleninstitute/vis-core'; | ||
| import { ZarrFetchStore, type CachingMultithreadedFetchStoreOptions } from './cached-loading/store'; | ||
|
|
||
| export function decoderFactory(url: string, workerModule: URL, options?: CachingMultithreadedFetchStoreOptions) { |
There was a problem hiding this comment.
this file is the only (interesting) non-cherry-picked change here - the rest is directly plucked from #203
| }; | ||
| useEffect(() => { | ||
| if (cnvs.current && server && !renderer) { | ||
| const { decoder } = decoderFactory(getResourceUrl(props.res), WORKERS); |
There was a problem hiding this comment.
here is where we create the decoder - we create it when we are about to load the data... now that i'm looking at this, it wont ever re-create the decoder (like say, when you want to view a different file), but thats been an issue forever in this demo, so maybe its fine
Jarbuckle
left a comment
There was a problem hiding this comment.
Just a couple small things!
| }; | ||
| useEffect(() => { | ||
| if (cnvs.current && server && !renderer) { | ||
| const { decoder } = decoderFactory(getResourceUrl(props.res), WORKERS); |
There was a problem hiding this comment.
Are we concerned at all about the prospect of useEffect() calls happening multiple times and producing a lot of workers? Will the old workers be discarded by the GC?
There was a problem hiding this comment.
excellent question - yes we should be concerned... i dont think that is happening in this very canned demo... but we should consider preventing that scenario!
as for workers being GC'd - I dont think that happens... workers have to be killed externally with terminate() I think. I'll see about how we would do that in a sane way....
|
Set it up locally and tested, working just great! |
packages/omezarr/src/zarr/cached-loading/fetch-data.worker-loader.ts
Outdated
Show resolved
Hide resolved
packages/omezarr/src/zarr/cached-loading/fetch-data.worker-loader.ts
Outdated
Show resolved
Hide resolved
Jarbuckle
left a comment
There was a problem hiding this comment.
Looks good to me! Works well, seems to cover what we need it to cover! Woo!
Jarbuckle
left a comment
There was a problem hiding this comment.
Hold that -- something's not quite working right: I'm trying to view the example OME-Zarr in the Priority Cache example page and it's not loading 😟
Cached Fetching via zarrita store
What
How
Known issues
Screenshots
This section is optional if there are no visible changes
PR Checklist
main?