On Nov 15, 2009, at 7:49 PM, Richard Tew wrote:
I pictured it having an interface like:

while True:
    selected_channel = select(quit_channel, request_channel)
    if selected_channel is quit_channel:
        return
    elif selected_channel is request_channel:
        ....

That would also work, but I wondered if it would be used with dispatch methods, like

dispatch_table = {
  "quit": quit_function,
  "request": request_function,
}
name, item = select(quit=quit_channel, request=request_channel)
dispatch_table[name](item)

But again, I cannot think of any use cases offhand that would benefit
from it.  As it stands, I see Stackless being a basic framework of
low-level functionality.  Solutions like 'select' are perhaps better
coded to address actual needs in custom frameworks built on the
low-level framework that is Stackless.

It's interesting seeing the comments about my post as it makes its away around the sites I read. I've seen a few people comment that Stackless is crippled because it doesn't support a way to select on multiple channels. I've pointed out my solution, but those who complained haven't said one thing or another about it.


                                Andrew
                                [email protected]



_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless

Reply via email to