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.
  • Constructor Details

    • FrameConsumerResultCallback

      public FrameConsumerResultCallback()
  • Method Details

    • addConsumer

      public void addConsumer(OutputFrame.OutputType outputType, Consumer<OutputFrame> consumer)
      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 configure
      consumer - the consumer to use for that output type
    • onNext

      public void onNext(com.github.dockerjava.api.model.Frame frame)
    • onError

      public void onError(Throwable throwable)
      Specified by:
      onError in interface com.github.dockerjava.api.async.ResultCallback<com.github.dockerjava.api.model.Frame>
      Overrides:
      onError in class com.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame>
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class com.github.dockerjava.api.async.ResultCallbackTemplate<FrameConsumerResultCallback,com.github.dockerjava.api.model.Frame>
      Throws:
      IOException
    • getCompletionLatch

      public CountDownLatch getCompletionLatch()
      Returns:
      a CountDownLatch that may be used to wait until close() has been called.