Skip to content

Commit

Permalink
Update Java version of container logs example
Browse files Browse the repository at this point in the history
  • Loading branch information
Natan Vieira do Nascimento committed Aug 6, 2023
1 parent abad256 commit 5f8a742
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,24 @@ val logs: Flow<Frame> = dockerClient.containers.logs("floral-fury") {
stdout = true
}

logs.onStart { ... }
logs.onStart { /* streaming started */ }
.onCompletion { /* streaming finished */ }
.catch { /* something went wrong */ }
.collect { log -> /* do something with each log */ }
```
```java
final YokiFlow<Frame> callback = new YokiFlow<Frame>() {
@Override
public void onEach(Frame log) {
// do something with each log
}
public void onEach(Frame log) { /* do something with each log */ }

@Override
public void onStart() { /* streaming started */ }

@Override
public void onComplete(Throwable error) { /* streaming finished */ }

@Override
public void onError(Throwable cause) {
// something went wrong
}
public void onError(Throwable cause) { /* something went wrong */ }
};

dockerClient.containers.logs("floral-fury", callback);
Expand Down

0 comments on commit 5f8a742

Please sign in to comment.