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 Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final Writerprivate final LinkedList<Future<String>> -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
orderedFutures
-
internalWriter
-
closed
private boolean closed
-
-
Constructor Details
-
FutureWriter
-
-
Method Details
-
enqueue
- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-