Package io.pebbletemplates.pebble.utils
Class FutureWriter
java.lang.Object
java.io.Writer
io.pebbletemplates.pebble.utils.FutureWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
A Writer that will wrap around the user-provided writer if the user also provided an
ExecutorService to the main PebbleEngine. A FutureWriter is capable of handling Futures that will
return a string.
It is not thread safe but that is okay. Each thread will have its own writer, provided by the
"parallel" node; i.e. they will never share writers.
-
Field Details
-
orderedFutures
-
internalWriter
-
closed
private boolean closed
-
-
Constructor Details
-
FutureWriter
-
-
Method Details
-
enqueue
- Throws:
IOException
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-