Skip to content

feat: query cancellation #53

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

Merged
merged 11 commits into from
Jan 23, 2024
Merged

feat: query cancellation #53

merged 11 commits into from
Jan 23, 2024

Conversation

vpbs2
Copy link
Contributor

@vpbs2 vpbs2 commented Jan 13, 2024

Add method to empty queue

no-work-item

@vpbs2 vpbs2 requested a review from itsTalwar January 13, 2024 08:20
@vpbs2 vpbs2 changed the title add: queue empty method feat: query cancel signal Jan 18, 2024
connectionId?: string,
reject?: (reason?: any) => void
): void {
signal?.addEventListener('abort', async (reason: Event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the event listener when the signal is completed ?

tableNames: string[],
options?: QueryOptions
) {
private _abortSignal(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to signalHandler or signalListener

Comment on lines 353 to 358
/**
* Empty the queue
*/
public async emptyQueue() {
this.queriesQueue = [];
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use-case for this ?

public async queryWithTableNames({
query,
tableNames,
connectionId,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not ask the consumer to pass this, auto-assign this id within this function

@vpbs2 vpbs2 merged commit 1dd17d4 into main Jan 23, 2024
@vpbs2 vpbs2 changed the title feat: query cancel signal feat: query cancellation Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants