List of usage examples for javax.servlet WriteListener onWritePossible
public void onWritePossible() throws IOException;
From source file:com.kolich.curacao.examples.controllers.NonBlockingIOExampleController.java
@PUT("/api/nonblocking") public final void nonblocking(final AsyncContext context, final HttpServletRequest request, final HttpServletResponse response, final ServletInputStream input, final ServletOutputStream output) throws Exception { final Queue<Option<String>> queue = new ConcurrentLinkedQueue<Option<String>>(); final WriteListener writer = new StupidWriteListener(context, queue, output); final ReadListener reader = new StupidReadListener(queue, input, output, writer, request.getContentLength()); // Producer//from ww w . j a va2 s. co m input.setReadListener(reader); logger__.info("Tomcat, is input ready?: " + input.isReady()); reader.onDataAvailable(); // Consumer output.setWriteListener(writer); logger__.info("Tomcat, is input ready?: " + output.isReady()); writer.onWritePossible(); }