On Thu, 2006-10-19 at 13:17 +0100, ant elder wrote: 
> I'd be interested in having a peek.
> 
>    ...ant
> 

All right. Here it is.
http://svn.apache.org/viewvc?view=rev&revision=465656

The main goal of this API is to provide a non-blocking HTTP transport
with a minimal memory footprint and without excessive content buffering,
thus avoiding 'out of memory' conditions under heavy load. The API is
filly event driven. There is no need for worker threads at any point of
time. All content processing takes place at the I/O reactor thread. 

When the implementation is reasonably stable I would like to 'bolt' our
standard HttpCore protocol layer on top of this API in order to provide
a convenient and consistent HTTP service interface for those
applications that rely on RequestInterceptor / ResponseInterceptor
interfaces for protocol handling and InputStream / OutputStream
interfaces for content manipulation and can afford a worker thread per
request / response.

Comments, suggestions, critique will be highly appreciated.

Evil Comrade Oleg

==============================

Abstract non-blocking HTTP connection interface. It can be used to
request or temporarily suspend event notifications that are triggered
when the underlying channel is ready for input / output operations
------------------
public interface NHttpConnection extends HttpConnection {

    void requestInput();
    
    void suspendInput();
    
    void requestOutput();
    
    void suspendOutput();
    
    HttpContext getContext();
    
}

Abstract non-blocking client-side HTTP connection. It can be used to
submit HTTP requests and asynchronously receive HTTP responses
------------------

public interface NHttpClientConnection extends NHttpConnection {

    HttpResponse getHttpResponse();

    void submitRequest(HttpRequest request) throws HttpException;

    boolean isRequestSubmitted();
    
}

Abstract non-blocking server-side HTTP connection. It can be used to
receive HTTP requests and asynchronously submit HTTP responses. 
------------------

public interface NHttpServerConnection extends NHttpConnection {

    HttpRequest getHttpRequest();

    void submitContinue() throws HttpException;

    void submitResponse(HttpResponse response) throws HttpException;

    boolean isResponseSubmitted();
    
}

Abstract server-side HTTP event handler
------------------

public interface NHttpServiceHandler {

    void requestReceived(NHttpServerConnection conn);

    void inputReady(NHttpServerConnection conn, 
        ContentDecoder decoder);
    
    void outputReady(NHttpServerConnection conn, 
        ContentEncoder encoder);
    
    void exception(NHttpServerConnection conn, IOException ex);
    
    void exception(NHttpServerConnection conn, HttpException ex);

    void timeout(NHttpServerConnection conn);
    
    void closed(NHttpServerConnection conn);
        
}

Abstract HTTP content decoder. HTTP content decoders can be used to read
entity content from the underlying channel in small chunks and apply the
required coding transformation.
------------------

public interface ContentDecoder {

    void read(ByteBuffer dst) throws IOException;
    
    boolean isCompeted();
    
}

Abstract HTTP content encoder. HTTP content encoders can be used to
apply the required coding transformation and write entity content to the
underlying channel in small chunks.
------------------

public interface ContentEncoder {

    void write(ByteBuffer src) throws IOException;
    
    void complete() throws IOException;
    
    boolean isCompeted();
    
}

========================================

> On 10/19/06, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
> >
> > Folks,
> >
> > A short update just to keep you all in the loop.
> >
> > The event-driven HTTP transport I have been working in the past days is
> > still too flaky to be committed to SVN. It may take me another while
> > before I am (more or less) sure the new code in NIO extensions is ready
> > for the first round of reviews. However I feel the public interfaces
> > (API) are reasonably complete and _should_ stay stable while I am still
> > hacking on the implementation. There is already enough substance to see
> > how things are shaping up and give me some feedback. If any of you want
> > to take an early peek at the API please let me know and I'll check the
> > interfaces in.
> >
> > Cheers
> >
> > Oleg
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to