Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parallel fetching #51

Open
KasperZutterman opened this issue Nov 4, 2021 · 0 comments
Open

Allow parallel fetching #51

KasperZutterman opened this issue Nov 4, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KasperZutterman
Copy link
Collaborator

Enable the EventStream to run fetchNextPage() in parallel for faster execution.
Keep in mind that exporting should not be broken.

public async _read() {
try {
if (!this.downloading && this.paused) {
super.pause();
}
else if (!this.downloading && !this.isPaused() && this.bookkeeper.nextFragmentExists()) {
if (!this.disableSynchronization && this.bookkeeper.inSyncingMode() && !this.syncingmode) {
this.syncingmode = true;
this.emit('now only syncing');
}
await this.fetchNextPage();
}
else if (!this.downloading) {
//end of the stream
this.log('info', "done");
this.push(null);
}
} catch (e) {
console.error(e);
}
}

@KasperZutterman KasperZutterman added the enhancement New feature or request label Nov 4, 2021
@KasperZutterman KasperZutterman self-assigned this Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant