Stackless Python/Twisted example Re: [Twisted-Python] Advice sought on application evolution

Andrew Francis andrewfr_ice at yahoo.com
Thu Apr 3 09:21:25 MDT 2008


Hi Don and Colleagues:

>I'll be very interested to learn more about the
>melding of the two paradigms.

...

>One question: I had the impression that Stackless is
>mostly an academic exercise, sort of a proof of
>concept.  Is this wrong?  How stable, portable, etc.
is Stackless at this point?  Is it a reasonable choice

>for a commercial application?

Sorry for the wait - I have been very busy. I will
probably update my blog on the weekend. Meanwhile, I
have enclosed an example of a Toy WS-BPEL processor
prototype that more or less implements the I/O parts
of WS-BPEL specification: invoke, reply, receive,
wait, event handlers, and daemons!

In the process, the programme shows all the
integration techniques in action.

The main thing I want readers to take away is how
*little* Stackless Python and Twisted are needed to
implement something complex. To me, this is what
Python is all about.

In your case Don, I try to show how layering helps
model business logic. In the example, think of the
Process and AlarmProcess belonging to the business
logic layer.

I have tried my best to strip away the WS-BPEL
specific parts to show how I integrate Stackless with
Twisted. Still the architecture is influenced by my
need to prototype. I am still experimenting.

That said, this little prototype starts up 1001
tasklets. If a web client does a HTTP GET on
http://localhost:8080/[0-999],
the tasklet will wake up, call a web server (in my
case Apache), and return a result. Another tasklets
simply ticks.

Give me a while, and I will show another example with
process serialization (at Pycon 2008 - I demonstrated
process serialization to a few folks after my talk -
hint Twisted does not like to be pickled).

Unfortunately I have not had time to set up stress
tests. I really don't have access to large computers.

That said, the integration techniques reflect my
thinking about November/December 2007. I am eager to
find the time to try out Christopher Armstrong's
coroutine package.

If you have any questions, please don't hesitate to
ask.

Cheers,
Andrew





      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ToyProcessor5.py
Type: text/x-python
Size: 13003 bytes
Desc: 1310978246-ToyProcessor5.py
URL: </pipermail/twisted-python/attachments/20080403/b2046098/attachment-0002.py>


More information about the Twisted-Python mailing list