[Stackless] About Pickling Stackless with ZODB

Johan Carlsson johanc at easypublisher.com
Thu Sep 20 08:12:32 CEST 2007

On 9/19/07, Andrew Francis <andrewfr_ice at yahoo.com> wrote:
> Hi Johan and Colleagues:
> >Next thing I'm gonna play with is to create a Tasklet
> >service and also a channel service (at least If i
> >wanna pass channels around I need to store them some
> >where).
> Although I haven't used Zope, I am interested in
> pickling tasklets and channels. Eventually I would
> like to use a database. Some thoughts.
> >The Tasklet service stores the tasklets and on
> startup >can activate all tasklet that are alive.
> I prototype WS-BPEL processors. I intend to use
> pickling to store WS-BPEL scripts that have been
> waiting a long time for I/O. From the experiments I
> have done (I have posted on this over the past year) I
> find that there are two specific issues pertaining to
> pickling:
> 1. Pickling the state of the entire processor (for the
> most part - this is relatively straightforward).
> 2. Pickling the state of an individual WS-BPEL script
> (running in the processor). This is a bit more complex
> since it would be nice to detract and re-attach
> tasklets from channels (and make these scripts
> candidates for garbage collection) - pickling does not
> automatically do this. To help, I have a channel class
> that has attach/detach methods. I haven't mastered the
> ins and outs of pickling yet.
> Right now one of things that most interests me is
> pickling channels and tasklets in a common "package."
> (right now, I use two separate files).
> >I think there is still issues I'm gonna encounter,
> >so I'm gonna go down this path a little bit further.
> >I let you all know what I find.
> I would be really interested to find out.

Thanks for the input Andrew :-D

Well, I obviously haven't even though about pickling issues yet.
So thanks for pointing me in that direction.

Pickling a channel, will also pickle any tasklets currently blocked on
it. But sometimes you just want to pickle the channel with only some
of those tasklets still blocked on it, or perhaps, tasklets you
isolate from the channel on their own. You can do this by using
__reduce__ and __setstate__.

I think this is where I'm currently having problems, I think I need to reattach
tasklets somehow.
As of now I pickel the tasklets twice, once in the tasklet storeage and once
for any channel that has a blocking tasklet.

Thanks again mate, I'll keep you all updated.
Johan Carlsson
Colliberty Easy Publisher

More information about the Stackless mailing list