hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCORE-148) Create AsyncNHttpServiceHandler & AsyncNHttpClientHandler
Date Mon, 18 Feb 2008 11:00:36 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569850#action_12569850

Oleg Kalnichevski commented on HTTPCORE-148:

Hi Sam

(1) I slept over this patch and felt we should spend a little more time on refining the API.
I can't help feeling that the use of blocking HttpRequestHandler interface in AsyncNHttpServiceHandler
makes things uglier than necessary. What if we defined a new interface that fitted better
the asynchronous nature of AsyncNHttpServiceHandler? How about this or something similar?

public interface NHttpRequestHandler {

    ConsumingNHttpEntity entityRequest(
            HttpEntityEnclosingRequest request, HttpContext context);
    void entityContent(
            HttpEntityEnclosingRequest request, ConsumingNHttpEntity entity, HttpContext context);
    void handle(
            HttpRequest request, NHttpResponseTrigger responseTrigger, HttpContext context);

public interface NHttpResponseTrigger {

    void submit(HttpResponse response);

* This API would eliminate the need for ContentListender, ResponseListener and BlockingHandler

* No need to inject a ContentListender into the ConsumingNHttpEntity
* The same API could be used for pipelining capable implementation of AsyncNHttpServiceHandler

(2) NHttpEntity interface seems not very useful. Why would one ever want to use this interface?
How about just putting #finish into ConsumingNHttpEntity and ProducingNHttpEntity?

What do you think?


> Create AsyncNHttpServiceHandler & AsyncNHttpClientHandler
> ---------------------------------------------------------
>                 Key: HTTPCORE-148
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-148
>             Project: HttpComponents Core
>          Issue Type: New Feature
>          Components: HttpCore NIO
>    Affects Versions: 4.0-beta2
>            Reporter: Sam Berlin
>            Assignee: Oleg Kalnichevski
>         Attachments: changes.txt
> Attached is a patch for AsyncNHttpServiceHandler.  It actually works (as tested by running
& hitting it with IE.)  :)
> To test, run the example 'AsyncNHttpFileServer' in the examples directory or the TestAsyncNHttpHandlers

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message