You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`AsyncReadable<Options>` existed so stores could receive arbitrary
per-call state. Auth headers, presigning context, cancellation signals,
even chunk-layer concerns like caching and prefetch priority (#296,
vole-core's `wrapArray`).
It was a catch-all for extensions that had nowhere else to live, and the
cost was a pile of type magic: higher-kinded-type encoding in the store
middleware system (#384), threading generic types that didn't actually
provide that much type safety. (TypeScript could often bail out to `any`
when inference broke.)
Those extensions now have proper homes. Store middleware (#384) gives
transport-layer concerns (auth, presigning, request transformation) a
proper extension point, and the custom `fetch` option on `FetchStore`
(#388) handles the per-store cases at the callsite. Chunk-layer concerns
will move to `zarr.extendArray` in a follow-up.
What's left is `signal`, which now lives properly on the (non-generic)
`AsyncReadable` interface and can be passed directly in `zarr.get` and
`zarr.set` from the caller:
// Before
interface AsyncReadable<Options = unknown> {
get(key: AbsolutePath, opts?: Options): Promise<Uint8Array | undefined>;
}
await zarr.get(arr, null, { opts: { signal: ctl.signal } });
// After
interface AsyncReadable {
get(key: AbsolutePath, opts?: { signal?: AbortSignal }): Promise<Uint8Array | undefined>;
}
await zarr.get(arr, null, { signal: ctl.signal });
Batched caller signals in `withRangeBatching` are now merged with
`AbortSignal.any` instead of a user-supplied `mergeOptions` reducer. The
deprecated `opts?: { signal? }` shape still works for one major version
and is folded into the new `signal` via `AbortSignal.any`.
0 commit comments