Skip to content

Commit da7d17d

Browse files
committed
[#4] [edit] according to dotnet-etcd 7.2
1 parent 0ec1983 commit da7d17d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/Etcd.Microsoft.Extensions.Configuration/Client/EtcdKeyValueClient.cs

+3-11
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,14 @@ private void OnWatchCallback(WatchResponse response)
231231
x.Kv.Value.ToStringUtf8())));
232232
}
233233

234-
private Task StopWatchAsync(long watchID)
235-
{
236-
return _client.Watch(new WatchRequest
234+
private Task StopWatchAsync(long watchID) =>
235+
_client.WatchAsync(new WatchRequest
237236
{
238237
CancelRequest = new WatchCancelRequest
239238
{
240239
WatchId = watchID
241240
}
242241
}, OnWatchCallback, GetMetadata());
243-
}
244242

245243
private void StopWatchAll()
246244
{
@@ -263,11 +261,5 @@ private void StopWatchAll()
263261
}
264262

265263
private void Watch(string key) =>
266-
_client.Watch(new WatchRequest
267-
{
268-
CreateRequest = new WatchCreateRequest
269-
{
270-
Key = ByteString.CopyFromUtf8(key)
271-
}
272-
}, OnWatchCallback, GetMetadata());
264+
_client.Watch(key, OnWatchCallback, GetMetadata());
273265
}

0 commit comments

Comments
 (0)