Package run.halo.gradle.docker
Class FrameConsumerResultCallback
java.lang.Object
com.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame>
run.halo.gradle.docker.FrameConsumerResultCallback
- All Implemented Interfaces:
com.github.dockerjava.api.async.ResultCallback<com.github.dockerjava.api.model.Frame>,Closeable,AutoCloseable
public class FrameConsumerResultCallback
extends com.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame>
This class can be used as a generic callback for docker-java commands that produce Frames.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.dockerjava.api.async.ResultCallback
com.github.dockerjava.api.async.ResultCallback.Adapter<A_RES_T extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsumer(OutputFrame.OutputType outputType, Consumer<OutputFrame> consumer) Set this callback to use the specified consumer for the given output type.voidclose()voidvoidonNext(com.github.dockerjava.api.model.Frame frame) Methods inherited from class com.github.dockerjava.api.async.ResultCallbackTemplate
awaitCompletion, awaitCompletion, awaitStarted, awaitStarted, onComplete, onStart, throwFirstError
-
Constructor Details
-
FrameConsumerResultCallback
public FrameConsumerResultCallback()
-
-
Method Details
-
addConsumer
Set this callback to use the specified consumer for the given output type. The same consumer can be configured for more than one output type.- Parameters:
outputType- the output type to configureconsumer- the consumer to use for that output type
-
onNext
public void onNext(com.github.dockerjava.api.model.Frame frame) -
onError
- Specified by:
onErrorin interfacecom.github.dockerjava.api.async.ResultCallback<com.github.dockerjava.api.model.Frame>- Overrides:
onErrorin classcom.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame>
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classcom.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame> - Throws:
IOException
-
getCompletionLatch
- Returns:
- a
CountDownLatchthat may be used to wait untilclose()has been called.
-