Python threading?
Thomas Heller
thomas.heller at ion-tof.com
Thu Sep 26 08:15:50 EDT 2002
"Robert Oschler" <Oschler at earthlink.net> writes:
> Having written _many_ state machines in my life, which async programming
> boils down to in one form or another, I feel it depends on the task. When
> you have an async event driven model, the code that services a
> "transaction-package" ends up spreading functionality that services the
> "transaction-package" application's code landscape. This can frequently be
> a headache. As an example of a "transaction-package", take all the steps
> involved in servicing an incoming TCP connection, with custom authentication
> of a user, and perhaps a header and data object transacttion or two,
> finishing with a proper ending and cleanup of the transaction, and with
> subsequent notification of all necessary modules and data structures of the
> results of the transaction. For dessert add a centralized clean error
> handler that can log errors propertly and gracefully recover the app
> regardless of where in the distributed event flow the error took place.
>
> Contrast this with a simple procedure call where a linear series of function
> calls are made, each with appropriate error handling and status adjustment,
> in a pleasant centrally located manner.
>
I wonder if generators can come to a rescue here?
Still trying to get them into my head...
Thomas
More information about the Python-list
mailing list