[PEAK] Re: PEAK and Twisted, revisited

Ulrich Eck ueck at net-labs.de
Fri Apr 16 03:46:11 EDT 2004


Hi Stephen,

> > in PEAK you use the EventDriven Component as App-Component (or
> > subclasses of it) instead of Twistd. peak.event.Tasks are then
> > scheduled in the TwistedReactor that can use async io/deferreds
> 
> Is there any example (preferably non-web) code for this?
> In particular, my application uses the usual Twisted chains of
> callbacks/errbacks ... have these been implemented or
> experimented with in a PEAK context?

hmm, afaik there is no simple peak<->twisted-demo around. we should
work one out i think comparable to the bulletins example. junction
from peakplace also uses twisted.pb, but not yet peak.events afaik.

you can yield twisted-deferreds within task-objects, to get back control
and result when the deferred's callback fires. so you don't need to
write n methods that are chained but just yield on
Conditions/Events/Deferreds to asynchronously chain calls.

> Also, I've been looking at your nll.database.sqldm,
> and it looks like it has a lot of what I would need.  How close
> is it to being usable?  I don't necessarily need stability (my
> code is evolving, too, and I've been using Twisted for 2 years
> now, so that says something about my tolerance for the bleeding
> edge ;).  I notice several items in your TODO.txt, such as
> bringing it up to date with the latest changes to PEAK ... does
> that apply to nll.database.sqldm?

SQLDM should be easily refactored by just rewriting all the
binding-names and replacing the MetaClasses with LateBindings. 
the reason why i didn't spend too much time on it is,
that pje plans to completly refactor the DataManager API to integrate
with peak.events and peak.query. a concrete timetable and design for
this refactoring is not yet available i think.

> I currently use Twisted's adbapi, and I don't see anything in
> PEAK like it (doesn't mean it's not there, of course ;).  It can
> use psycopg as its wrapped DBAPI driver, so might somehow
> be made to work with some existing peak.storage module.
> Any suggestions on how best to integrate it into a PEAK
> application?

DataManagers currently force you to be Synchronous (el = dm[oid])
a new paradigm of fetching DomainElements would probably be necessary
to find a sensible way of doing this async.

[snip design]
pje could help with this probably better

cheers
Ulrich

-- 
--------------------------

Ulrich Eck
net-labs Systemhaus GmbH
CEO & Code-Artist
Ebersberger Str. 46
85570 Markt Schwaben - Germany

eMail: ueck <at> net-labs.de
phone: +49 8121 4747 10
fax:   +49 8121 4747 77




More information about the PEAK mailing list