You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2007/09/28 22:39:50 UTC

[jira] Commented: (DIRMINA-375) Synchronous Client API

    [ https://issues.apache.org/jira/browse/DIRMINA-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531153 ] 

Trustin Lee commented on DIRMINA-375:
-------------------------------------

First of all, thank you very much Brad for excellent idea and contribution!  Literally cool! :D

I think Brad's patch can be easily integrated into IoSession; IoSession could have a read() method that returns ReadFuture:

* Object m = session.read().await(10000).getMessage(); // Returns null unless received within 10 sec.
* Object m = session.read(10000).await().getMessage(); // Throws exception unless received within 10 sec.

This could be implemented by adding a queue of ReadFutures to IoSession and modifying DefaultIoFilterChain to poll the ReadFuture and give notification for each messageReceived event.  By utilizing existing facilities that IoSession and MINA provides, the amount of change could become much smaller.

Possible list of thrown exceptions would be:

* EOFException - if the session is closed.
* SocketTimeoutException - on timeout

One problem is that these exceptions are not a RuntimeIoException.  We could create DisconnectionException and ReadTimeoutException that extend RuntimeIoException though.

WDYT everyone?

> Synchronous Client API
> ----------------------
>
>                 Key: DIRMINA-375
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-375
>             Project: MINA
>          Issue Type: New Feature
>            Reporter: Brad Harvey
>             Fix For: 2.0.0-M1
>
>         Attachments: EchoClient.java, minaClient.patch, SumUpClient.java
>
>
> Hi,
> There was mention of a synchronous client api for MINA on the mailing list, so I thought I'd offer my implementation.
> http://www.nabble.com/forum/ViewPost.jtp?post=10445399&framed=y
> As far as I can tell it works, but I've never given it a good run under heavy load.  The areas I think could use some review are:
> Connection - possible to use generics?  Only makes sense if you can tie it to what the filters are doing I think.
> ConnectionFactoryImpl - is the managedSessions processing required?
> SequentialExecutor/DaemonThreadFactory - are there better/pre existing ways of doing these?
> Connection/NonBlockingConnection - any point having them separate?  Did this initially for JCA resource adapter idea - didn't want to offer non blocking to EJB clients.
> Regards,
> Brad.

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