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

RDoc-2537 Add operation.Kill + WaitForCompletion overload #1736

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

Danielle9897
Copy link
Member

@Danielle9897 Danielle9897 commented Jan 2, 2024

Related issue:
https://issues.hibernatingrhinos.com/issue/RDoc-2537/Add-operation.Kill-WaitForCompletion-overload


C#:

  • Fixed 'why use operation' text
  • Added operation.kill
  • Added operation.WaitForCompletion with cancellation token
  • @haludi - pls review files:
    Documentation/5.4/Raven.Documentation.Pages/client-api/operations/what-are-operations.dotnet.markdown
    Documentation/5.4/Samples/csharp/Raven.Documentation.Samples/ClientApi/Operations/WhatAreOperations.cs
    

Node.js:

  • Fixed 'why use operation' text
  • Added operation.kill
  • @ml054 - pls review files:
    Documentation/5.4/Raven.Documentation.Pages/client-api/operations/what-are-operations.js.markdown
    Documentation/5.4/Samples/nodejs/client-api/operations/whatAreOperations.js
    

@Danielle9897 Danielle9897 requested review from ml054 and haludi January 2, 2024 16:47
Operation operation = documentStore.Operations.Send(deleteByQueryOp);

// Call 'Kill' to abort operation
operation.Kill();
Copy link
Member Author

@Danielle9897 Danielle9897 Jan 2, 2024

Choose a reason for hiding this comment

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

@ppekrol @haludi

Here I didn't add the following assertion because of RavenDB-21875

// Assert that operation is no longer running
Assert.Throws<TaskCanceledException>(() => operation.WaitForCompletion(TimeSpan.FromMinutes(1)));

Copy link
Member Author

@Danielle9897 Danielle9897 Jan 3, 2024

Choose a reason for hiding this comment

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

@ppekrol @haludi

So what would be the best way to show the operation is Not running anymore?
Send GetOperationStateOperation ?

When I run that after the 'Kill' I get in the state result:
Progress = null, Result = null, Status = InProgress

Copy link
Contributor

Choose a reason for hiding this comment

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

You can keep pinging by GetOperationStateOperation until the progress stats is changed

@Danielle9897 Danielle9897 changed the title Add operation.Kill + WaitForCompletion overload RDoc-2537 Add operation.Kill + WaitForCompletion overload Jan 4, 2024
@ppekrol ppekrol merged commit 156e6b9 into ravendb:master Jan 11, 2024
1 of 2 checks passed
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.

4 participants