-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add examples about how to use all etcd operations #22
Comments
I found how to set a key with ttl. EtcdClient client = new EtcdClient("127.0.0.1", 2379);
long leaseId = client.LeaseGrant(new LeaseGrantRequest
{
TTL = ttl
}).ID;
client.Put(new PutRequest
{
Key = ByteString.CopyFromUtf8(key),
Value = ByteString.CopyFromUtf8(val),
Lease = leaseId
}); And this can keep lease alive, but I am not sure what are client.LeaseKeepAlive(new LeaseKeepAliveRequest
{
ID = leaseId
}, LeaseKeepAliveHandler, new CancellationToken());
private static void LeaseKeepAliveHandler(LeaseKeepAliveResponse rep)
{
Console.WriteLine($"Lease {rep.ID} keep alive");
} |
https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken?view=netframework-4.8 |
I am working on restructuring the lib's code a bit without hurting method signatures. I will try to update documentation as soon as I can. |
Actually I do not need to execute anything on |
Noted. For now, you can use the overload which takes an |
I need Doc about Lease too, thanks very much |
LeaseGrant and LeaseKeepAlive doc ? |
Is your feature request related to a problem? Please describe.
I want to use ETCD's ttl, and I noticed that there are some lease methods (
LeaseGrant
and so on) exposed from client, but I can't figure out how to use them.Describe the solution you'd like
Add some usage examples in
README.md
.Thank you for your creating the great client again.
The text was updated successfully, but these errors were encountered: