Skip to content

Commit 2aabc1c

Browse files
Merge pull request #95 from cliveseldon/master
add close to watch
2 parents bc382e2 + d88f641 commit 2aabc1c

File tree

1 file changed

+6
-1
lines changed
  • util/src/main/java/io/kubernetes/client/util

1 file changed

+6
-1
lines changed

util/src/main/java/io/kubernetes/client/util/Watch.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
* set watch to True and watch the changes to namespaces.
3232
*/
3333
public class Watch<T> implements Iterable<Watch.Response<T>>,
34-
Iterator<Watch.Response<T>> {
34+
Iterator<Watch.Response<T>>,
35+
java.io.Closeable {
3536

3637
/**
3738
* Response class holds a watch response that has a `type` that can be
@@ -120,4 +121,8 @@ public Iterator<Response<T>> iterator() {
120121
public void remove() {
121122
throw new UnsupportedOperationException("remove");
122123
}
124+
125+
public void close() throws IOException {
126+
this.response.close();
127+
}
123128
}

0 commit comments

Comments
 (0)