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

Feature lease keep alive with cancellation token source #223

Conversation

luboid
Copy link
Contributor

@luboid luboid commented Jul 27, 2024

Hi
I'm trying to build a distributed lock and I need a LeaseKeepAlive method with CancelationTokenSource parameter

  • Use the following format: luboid/dotnet-etcd
  • Link additions should be added to the bottom of the relevant category.
  • New categories or improvements to the existing categorization are welcome.
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • Sort by alphabetical order

Copy link
Owner

@shubhamranjan shubhamranjan left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 💯 . I will do a few more tests and release it in the next few days.

@shubhamranjan shubhamranjan merged commit 6c00889 into shubhamranjan:main Jul 27, 2024
2 checks passed
@luboid
Copy link
Contributor Author

luboid commented Jul 27, 2024

Thank you

@luboid
Copy link
Contributor Author

luboid commented Jul 29, 2024

Hi,
You can make a little change if you want, I do not want to open a new pull request
change signature of KeepAliveAsync to

Task KeepAliveAsync(object state)

and then it can be used like that

            return Task.Factory.StartNew(
                KeepAliveAsync,
                null,
                cancellationToken,
                TaskCreationOptions.LongRunning,
                TaskScheduler.Current)
                .Unwrap();

sorry if I bother you

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