Class IOTrio

java.lang.Object
io.kubernetes.client.custom.IOTrio

public class IOTrio extends Object
A collection of all the 3 main pipes used in stdio: STDIN, STDOUT and STDERR. As working with the named pipes is usually carried out asynchronously, this collection also provides means to initiate and handle the close() event. A close() initiator calls the close(int, long) method expressing its intent to close the communication channel. Handlers are notified of this intent and its up to the handlers to decide what's to be done next. Calling close(int, long) does not close the streams or do anything else besides notifying the handlers.
  • Constructor Details

    • IOTrio

      public IOTrio()
  • Method Details

    • getStdout

      public InputStream getStdout()
    • setStdout

      public void setStdout(InputStream stdout)
    • getStderr

      public InputStream getStderr()
    • setStderr

      public void setStderr(InputStream stderr)
    • getStdin

      public OutputStream getStdin()
    • setStdin

      public void setStdin(OutputStream stdin)
    • onClose

      public void onClose(BiConsumer<Integer,Long> handler)
      Capture the CLOSE intent and handle it accordingly.
      Parameters:
      handler - the handler that's invoked when someone intends to close this communication. Multiple handlers can be registered
    • close

      public void close(int code, long timeout)
      Express an intent to close this communication. This intent will be relayed to all the registered handlers and it's up to them what to do with it.
      Parameters:
      code - proposed exit code
      timeout - time in milliseconds given to terminate this communication. Negative timeout means no timeout (i.e. wait for as long as it takes). 0 means "stop it now".