Skip to content

Commit

Permalink
feat(core): allow overriding all chunk source delays
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Feb 11, 2022
1 parent 9ca865a commit b3091ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/chunk.source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export abstract class ChunkSourceBase implements ChunkSource {
/** By default create a new cache for every chunk source */
static DefaultChunkCache = (): Map<number, DataView> => new Map();

/** By default wait this amount of ms before running a fetch */
static DefaultDelayMs = 1;

/** size of chunks to fetch (Bytes) */
abstract chunkSize: number;
/** Reference to the source */
Expand All @@ -54,7 +57,7 @@ export abstract class ChunkSourceBase implements ChunkSource {
* Number of ms to wait before performing a fetch
* Larger numbers means more fetches will be grouped together
*/
delayMs = 1;
delayMs = ChunkSourceBase.DefaultDelayMs;
/**
* Max number of chunks to load in one go
* Requested chunks could be more than this number if blankFillCount is used
Expand Down

0 comments on commit b3091ad

Please sign in to comment.