Re: [Python-Dev] Active Objects in Python

2005-10-01 Thread Michael Sparks
On Friday 30 September 2005 22:13, Michael Sparks (home address) wrote: > I wrote a white paper based on my Python UK talk, which is here: >     * http://www.bbc.co.uk/rd/pubs/whp/whp11.shtml Oops that URL isn't right. It should be: * http://www.bbc.co.uk/rd/pubs/whp/whp113.shtml Sorry! (Thank

Re: [Python-Dev] Active Objects in Python

2005-09-30 Thread Michael Sparks (home address)
[ I don't post often, but hopefully the following is of interest in this discussion ] Bruce Eckel wrote: > Yes, defining an class as "active" would: > 1) Install a worker thread and concurrent queue in each object of that > class. > 2) Automatically turn method calls into tasks and enqueue them

Re: [Python-Dev] Active Objects in Python

2005-09-28 Thread Martin v. Löwis
Bruce Eckel wrote: > Since the enqueuing process serializes all requests to active objects, > and since each message-task runs to completion before the next one > starts, the problem of threads interfering with each other is > eliminated. Also, the enqueuing process will always happen, so even if >

Re: [Python-Dev] Active Objects in Python

2005-09-28 Thread Nick Coghlan
Greg Ewing wrote: > Nick Coghlan wrote: > > >>PEP 342's yield expressions can probably be used to help address that >>problem, >>though: >> >> class SomeAO(ActiveObject): >> def processSomeMessage(self): >> msg = yield >> # Do something with the message >> next_msg = yie

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Bruce Eckel
Oops. I forgot to add that to the list. Yes, in the working example of Active Objects that I've written in Java J2SE5, when you send a message to an active object, you get back a Future, which I suspect would be the same as your Deferred. Tuesday, September 27, 2005, 7:41:27 PM, Christopher Armstr

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Christopher Armstrong
On 9/28/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > Nick Coghlan wrote: > > > PEP 342's yield expressions can probably be used to help address that > > problem, > > though: > > > >class SomeAO(ActiveObject): > > def processSomeMessage(self): > >msg = yield > ># Do somethin

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Greg Ewing
Nick Coghlan wrote: > PEP 342's yield expressions can probably be used to help address that > problem, > though: > >class SomeAO(ActiveObject): > def processSomeMessage(self): >msg = yield ># Do something with the message >next_msg = yield makeSomeBlockingCall(s

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Nick Coghlan
Bruce Eckel wrote: > Since the enqueuing process serializes all requests to active objects, > and since each message-task runs to completion before the next one > starts, the problem of threads interfering with each other is > eliminated. Also, the enqueuing process will always happen, so even if >

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Benji York
Phillip J. Eby wrote: > Well, you could pickle and unpickle the objects you send from one function > to another, and for cross-process communication, you'll need to do > something like that anyway, or else use that shared-memory objects > thing. PySHM? I don't remember its name, but it's an ex

Re: [Python-Dev] Active Objects in Python

2005-09-27 Thread Phillip J. Eby
At 11:18 AM 9/27/2005 -0600, Bruce Eckel wrote: >Yes, defining an class as "active" would: >1) Install a worker thread and concurrent queue in each object of that >class. >2) Automatically turn method calls into tasks and enqueue them >3) Prevent any other interaction other than enqueued messages