Closed 9chu closed 4 years ago
Agreed. Using void
with async
is considered a bad practice as well. Something I learnt recently. Thanks for pointing out. Will fix this by tomorrow.
Thank you for your reply.
BTW, I am confused with the LeaseKeepAlive
method. Seems I have to manually call it many times to keep a lease key alived, and the method it self will create a grpc stream every time.
I think providing a method to automatically call keepalive may be more convenient :)
// returns a infinite loop task that keeps the lease key any TTL/2 seconds
await client.LeaseKeepAlive(leaseId, cancellationToken);
Thank you for your reply.
BTW, I am confused with the
LeaseKeepAlive
method. Seems I have to manually call it many times to keep a lease key alived, and the method it self will create a grpc stream every time.I think providing a method to automatically call keepalive may be more convenient :)
// returns a infinite loop task that keeps the lease key any TTL/2 seconds await client.LeaseKeepAlive(leaseId, cancellationToken);
I will look into this and get back.
Like calling
LeaseKeepAlive
, I have no way to detect whether it throws exception or not. Please consider usingasync Task
to return aTask
object to user.