twisted much?
John Arbash Meinel
john at arbash-meinel.com
Tue Jun 14 20:00:27 BST 2005
Aaron Bentley wrote:
> David Allouche wrote:
>
> >On Mon, 2005-06-13 at 12:50 -0400, Aaron Bentley wrote:
>
...
> >I am not familiar with asyncore programming, so I might be wrong, but
> >there are three inter-related reasons I can see.
>
> > * It does not allow you to defer tasks to an event loop that is
> > already running.
>
>
> Yes, you can. You just add entries to asyncore.socket_map.
>
> > * It does not provide facilities for voluntary scheduling.
> > * It does not offer a standard framework for writing asynchronous
> > API.
>
Are you sure about this? Medusa (an http/ftp server) is written on top
of asyncore.
Also, there is asynchat, which supports bi-directional async communication.
...
> >You may also consider the fact that Twisted is being considered for
> >inclusion in the Python distribution.
>
>
> Yes, I'd be much more inclined to use Twisted if it were not an extra
> dependency, but it currently still is.
I agree, it is nice right now that bzr doesn't have any required
dependencies.
>
> >It is easy to provide a synchronous API as a wrapper over a Twisted
> >asynchronous API, since the reactor (main loop handler) can be started
> >and stopped at will.
>
Well, asyncore requires that you call the "asnyncore.loop()" and you can
pass it a timeout/number of times to run. So I'm not as positive that it
can't be "started & stopped at will".
...
> Right, but it wouldn't be able to do anything useful until it had pulled
> those remote branches, which seems like very linear logic to me.
>
I would say you would want the remote "get" to be asyncronous so that
you can get pipelining. You might be able to do some sort of incremental
merge process, so that as new items come in, you get more information
about what you are trying to do. (Say you were looking for something
like a "bzr update" you could add one update at a time, as the required
information comes in).
But generally, I think you are right that there is a serialization point
where you have to wait to get all the data before you can do the next step.
> So a server might itself use Twisted, but work quite well with a
> synchronous api.
>
> >Though I dislike the additional complexity and big dependency, I think
> >that using an asynchronous framework (not library) is going to be
> >needed.
>
>
> I'd agree with 'going to be needed' (if things turn out as we expect),
> but not with 'is needed'.
>
> Aaron
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050614/d59ef14a/attachment.pgp
More information about the bazaar
mailing list