-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,007 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.coreos.jetcd; | ||
|
||
import com.coreos.jetcd.options.WatchOption; | ||
import com.coreos.jetcd.util.ListenableSetFuture; | ||
import com.coreos.jetcd.watch.Watcher; | ||
import com.google.protobuf.ByteString; | ||
|
||
/** | ||
* Interface of watch client | ||
*/ | ||
public interface EtcdWatch { | ||
|
||
|
||
/** | ||
* Watch watches on a key or prefix. The watched events will be called by onWatch. | ||
* If the watch is slow or the required rev is compacted, the watch request | ||
* might be canceled from the server-side and the onCreateFailed will be called. | ||
* | ||
* @param key the key subscribe | ||
* @param watchOption key option | ||
* @param callback call back | ||
* @return ListenableFuture watcher | ||
*/ | ||
ListenableSetFuture<Watcher> watch(ByteString key, WatchOption watchOption, Watcher.WatchCallback callback); | ||
|
||
/** | ||
* Cancel the watch task with the watcher, the onCanceled will be called after successfully canceled. | ||
* | ||
* @param watcher the watcher to be canceled | ||
*/ | ||
void cancelWatch(Watcher watcher); | ||
} |
Oops, something went wrong.