You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Paulo Sergio <pa...@gmail.com> on 2007/08/16 20:06:47 UTC

Imap Idle Command

Hi all,
are there any plans to implement the Imap Idle command?
i will need it to a project that i'm developing, so if there are no plans to
develop it,
i will work on it myself. but i might need some help.
what would  be the right approach to do it?
i probably should add imap idle to the command library, and then add a
processor to handle the request,
but how should i keep the connection open? to send the notifications back to
the client?

Cheers,
Paulo F.

Re: Imap Idle Command

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On 8/16/07, Paulo Sergio <pa...@gmail.com> wrote:
> Hi Robert,
> On 8/16/07, Robert Burrell Donkin <ro...@gmail.com> wrote:
> > On 8/16/07, Paulo Sergio <pa...@gmail.com> wrote:

<snip>

> > > what would  be the right approach to do it?
> > > i probably should add imap idle to the command library, and then add a
> > > processor to handle the request,
> > > but how should i keep the connection open?
> >
> > an IMAP client creates and holds open a connection to the server
> > throughout. the problem is that the current handler uses only one
> > thread.
> >
> > > to send the notifications back to the client?
> >
> > this means moving to a SEDA based design.
>
>
> but do you think i have to switch to a SEDA architecture ?  or SEDA  would
> just be a better  option?

i don't see how IDLE could be implemented using blocking IO and a
single thread. therefore the older, JAMES handler just isn't
sophisticated enough. so, a new handler architecture would need to be
adopted.

there are various ways to design these kinds of system.

the experimental IMAP stuff is aimed at an event driven architecture.
so, moving to SEDA is a relatively small amount of work.

if you prefer locking based architectures then it may be possible to
reuse the components but i recommend that you do enough up front
analysis of the protocol to ensure that the design is robust enough to
cope.

> > the medium term aim would be
> > to move to MINA and nio but in the short term, a three thread
> > implementation (input, output, processor) is a stepping stone which
> > would probably be satisfactory for IDLE. this should be relatively
> > easy to implement.
>
>
> yes i think Mina is a good choice, it seems to have a lot people working
> with it, and i've seen some good reviews about it.
> but is these just an idea or there is really a plan to implement it?

depends what you mean by a plan :-)

MINA is SEDA. it's pointless reinventing the wheel when there's
already a set of flashy alloys available.

- robert

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


Re: Imap Idle Command

Posted by Paulo Sergio <pa...@gmail.com>.
Hi Robert,

On 8/16/07, Robert Burrell Donkin <ro...@gmail.com> wrote:
>
> On 8/16/07, Paulo Sergio <pa...@gmail.com> wrote:
> > Hi all,
>
> hi paulo
>
> > are there any plans to implement the Imap Idle command?
>
> no immediate ones ;-)
>
> > i will need it to a project that i'm developing, so if there are no
> plans to
> > develop it,
> > i will work on it myself.
>
> glad to have a volunteer :-)
>
> > but i might need some help.
>
> not a problem
>
> > what would  be the right approach to do it?
> > i probably should add imap idle to the command library, and then add a
> > processor to handle the request,
> > but how should i keep the connection open?
>
> an IMAP client creates and holds open a connection to the server
> throughout. the problem is that the current handler uses only one
> thread.
>
> > to send the notifications back to the client?
>
> this means moving to a SEDA based design.


but do you think i have to switch to a SEDA architecture ?  or SEDA  would
just be a better  option?

the medium term aim would be
> to move to MINA and nio but in the short term, a three thread
> implementation (input, output, processor) is a stepping stone which
> would probably be satisfactory for IDLE. this should be relatively
> easy to implement.


yes i think Mina is a good choice, it seems to have a lot people working
with it, and i've seen some good reviews about it.
but is these just an idea or there is really a plan to implement it?

Cheers,
Paulo F.

the refactoring needs to be continued so that the encoders are not fed
> by a direct call but via messaging.
>
> one area which is going to require some legwork is the mailbox. each
> mailbox session (currently misnamed as mailbox) needs to feed events
> to a mailbox which can be subscribed to. this will allow any session
> to listen to changes made in any other. the IDLE processor should poll
> the IMAP sessions for changes, create messages and then send them down
> the pipe.
>
> (might be easier for me to explain this in a JIRA)
>
> - robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

Re: Imap Idle Command

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On 8/16/07, Paulo Sergio <pa...@gmail.com> wrote:
> Hi all,

hi paulo

> are there any plans to implement the Imap Idle command?

no immediate ones ;-)

> i will need it to a project that i'm developing, so if there are no plans to
> develop it,
> i will work on it myself.

glad to have a volunteer :-)

> but i might need some help.

not a problem

> what would  be the right approach to do it?
> i probably should add imap idle to the command library, and then add a
> processor to handle the request,
> but how should i keep the connection open?

an IMAP client creates and holds open a connection to the server
throughout. the problem is that the current handler uses only one
thread.

> to send the notifications back to the client?

this means moving to a SEDA based design. the medium term aim would be
to move to MINA and nio but in the short term, a three thread
implementation (input, output, processor) is a stepping stone which
would probably be satisfactory for IDLE. this should be relatively
easy to implement.

the refactoring needs to be continued so that the encoders are not fed
by a direct call but via messaging.

one area which is going to require some legwork is the mailbox. each
mailbox session (currently misnamed as mailbox) needs to feed events
to a mailbox which can be subscribed to. this will allow any session
to listen to changes made in any other. the IDLE processor should poll
the IMAP sessions for changes, create messages and then send them down
the pipe.

(might be easier for me to explain this in a JIRA)

- robert

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