public class HotFileFromProcess extends Object implements HotFile
| Modifier and Type | Field and Description |
|---|---|
protected io.reactivex.rxjava3.disposables.Disposable |
disposable |
protected Path |
path |
protected CompletableFuture<Path> |
resultFuture |
protected Channel |
writeChannel |
| Constructor and Description |
|---|
HotFileFromProcess(Path path,
io.reactivex.rxjava3.core.Single<Integer> processSingle) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Optional method to cancel the creation
|
static HotFileFromProcess |
createStarted(Path hotFile,
io.reactivex.rxjava3.core.Single<Integer> processSingle)
Calling this method will subscribe to the single (on Schedulers.io())
and thus start its attached process
|
CompletableFuture<Path> |
future()
A completable future that fires when the file creation is complete
or an exception occurred
|
void |
init(Path path,
io.reactivex.rxjava3.core.Single<Integer> processSingle) |
static void |
main(String[] args) |
InputStream |
newInputStream()
Open a new stream to the hot file
The input stream delivery may be delayed
until after the file creation is complete.
|
String |
toString() |
protected Path path
protected Channel writeChannel
protected io.reactivex.rxjava3.disposables.Disposable disposable
protected CompletableFuture<Path> resultFuture
public static HotFileFromProcess createStarted(Path hotFile, io.reactivex.rxjava3.core.Single<Integer> processSingle)
hotFile - The file being written toprocessSingle - The single capturing the processpublic void abort()
FileCreationabort in interface FileCreationpublic void init(Path path, io.reactivex.rxjava3.core.Single<Integer> processSingle)
path - The path being written to by the processprocessSingle - A cold single wrapping the process and yielding its exit codepublic CompletableFuture<Path> future()
FileCreationfuture in interface FileCreationpublic InputStream newInputStream() throws IOException
HotFilenewInputStream in interface HotFileIOExceptionpublic static void main(String[] args) throws InterruptedException, IOException
InterruptedExceptionIOExceptionCopyright © 2020. All rights reserved.