[Zope-Annce] zasync 1.0 released

Gary Poster gary at modernsongs.com
Fri Dec 17 12:41:20 EST 2004


I am happy to announce the 1.0 release of zasync, a Zope 2 product that 
enables tasks to be done asynchronously via a Twisted ZEO Client.

http://www.zope.org/Members/poster/zasync

What is it?

zasync is a Zope 2 product that enables tasks to be done 
asynchronously.  If your application needs to allow users to request 
that a long-running job be performed, but the user (and the Zope 
thread) shouldn't be tied up waiting for the job to complete, zasync is 
one possible solution.  When the result of the job is ready, zasync 
supports both push and pull: the response can trigger TALES expressions 
run in the security context of the user who made the call, or the call 
manager can be polled to see if the response is ready.

What are some examples of a long-running job?

- you need to poll a database that may take a very long time to respond
- you need the app to download something off the internet, maybe big, 
maybe just with a big timeout
- you need to do a long-running transaction within Zope itself 
(SUPPORTED, BUT HERE BE DRAGONS, i.e. ConflictError fun, particularly 
pre-Zope 2.8)
- you want the user to be associated with a long-running socket (e.g., 
an IM server component or a client) that should not be turned on and 
off within a single transaction

How does it work?

zasync is comprised of two sides: the side that lives in Zope and 
allows users to make asynchronous calls and poll for results; and the 
worker that actually does the jobs.  The worker is intended to be 
pluggable, maybe eventually supporting workers that live within the 
main Zope process so that developer boxes and low-load servers can use 
a worker simply.  However, zasync 1.0 ships with a single worker: a ZEO 
client driven by the Twisted reactor.

A Twisted ZEO client?

Yup.  The approach has some nice scalability advantages (it can be run 
on a different box, for instance).  It also comes with a few plugins, a 
couple for LDAP calls and one for calling back into Zope to do tasks.  
A plugin simply is a registered callable that can return a result 
(unlikely) or a deferred (much more likely).  The zasync client 
includes meaty logging.  The ZEO client must be configured using a 
standard ZConfig schema, and started using a (very bare bones at the 
moment) shell script.  Disadvantages include the fact that you have 
another process to keep track of, and that you have to keep up with an 
additional configuration.

Are there any docs?

Yup.  Of course, not as many or of as high a quality as I'd like.  
There's a README and a doctest for the call manager, as well as some 
docs and tests for some of the components.

Is it easy to set up?

Uh.  If you know zope.conf then it shouldn't be too hard to modify the 
files you need to.  I tried to include reasonable directions.

Does it work on Windows?

I imagine you could make it work on Windows: I wanted to make sure it 
was a possibility.  I haven't yet.  You might just need to get the 
start script right...

Does it work on UNIX-ish stuff?

Yup, it should work on a UNIX-ish system that runs the current stable 
Zope.

What does the future hold?

Wouldn't we all like to know.  This product is in active use at the 
moment, so development, or at least bug fixes, are likely.  I hope to 
port this to Zope 3, refactoring as I go to take advantages of lessons 
learned and maybe including the simpler non-ZEO worker also so that it 
is easier for developers and simpler deployments to get started.

Is this in a public version control repository?

Yup.  http://cvs.zope.org/Packages/zasync/ .  Shoulda been in Products: 
oh well. :-)  It has a package in there, at least...

Thanks to Zope Corporation for open sourcing this product!

Gary



More information about the Zope-Announce mailing list