Re: async-calls and Dispatchers

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Thu, 20 Dec 2007 08:58:46 -0700

On Thu, 2007-12-20 at 13:58 +1100, Robert Collins wrote:
> On Wed, 2007-12-19 at 23:09 +0000, Alex Rousskov wrote:
> > Update of cvs.devel.squid-cache.org:/cvsroot/squid/squid3/src
> >
> > Modified Files:
> > Tag: async-calls
> > AsyncCall.cc AsyncCall.h EventLoop.cc Makefile.am
> > Added Files:
> > Tag: async-calls
> > AsyncCallQueue.cc AsyncCallQueue.h
> > Log Message:
> > Async calls are not longer using time-based events with zero delay. They
> > have a dedicated AsyncCallQueue.
>
> Good so far.

> > I did not make the queue a child of the Dispatcher because I hope to get
> > rid of dispatchers eventually.

> Can I ask why? The point of the current design is to allow integrating
> some quite different sources of events *and* workers.

CompletionDispatcher was documented as "code to handle events that have
completed". It was implemented as an abstract "call me once per main
loop iteration" interface. We already have AsyncEngine class for that
(the purpose of AsyncEngine class is not really documented so I am
judging by the code).

The only serious difference between CompletionDispatcher and AsyncEngine
is the timeout games, but classes that do not care about timeouts can
simply ignore them. Only one timeout is actually supported anyway so we
may be able to simplify this further.

AsyncCallQueue dispatches calls now. It is a single simple/concrete
class and not a class hierarchy base like CompletionDispatcher.

Hope this clarifies my thinking. Comments and alternative designs are
very welcome.

Thank you,

Alex.
Received on Thu Dec 20 2007 - 08:58:53 MST

This archive was generated by hypermail pre-2.1.9 : Mon Dec 31 2007 - 12:00:03 MST