Package io.kubernetes.client.custom
Class IOTrio
java.lang.Object
io.kubernetes.client.custom.IOTrio
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(int code, long timeout) Express an intent to close this communication.getStdin()
void
onClose
(BiConsumer<Integer, Long> handler) Capture the CLOSE intent and handle it accordingly.void
setStderr
(InputStream stderr) void
setStdin
(OutputStream stdin) void
setStdout
(InputStream stdout)
-
Constructor Details
-
IOTrio
public IOTrio()
-
-
Method Details
-
getStdout
-
setStdout
-
getStderr
-
setStderr
-
getStdin
-
setStdin
-
onClose
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 codetimeout
- 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".
-