Fork me on GitHub

FutureWriter

In package com.mitchellbosecke.pebble.utils

public class FutureWriter extends Writer

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 it's own writer, provided by the "parallel" node; i.e. they will never share writers.

Constructors

public FutureWriter(Writer writer)
Parameters:
  • Writer writer

Methods

public void enqueue(Future<String> future)
Parameters:
  • Future<String> future
public void write(char cbuf, int off, int len)
Parameters:
  • char cbuf
  • int off
  • int len
public void flush()
Parameters:
  • No parameters
public void close()
Parameters:
  • No parameters