[Twisted-Python] Porting twisted methods to a synchronous environment

I have a server that provides access to a database in the usual way, using adbapi to talk to an MSSQL server. Now, I'm facing the need to create an application that can access the server directly. (In addition to, not instead of.) In the spirit of "write it once", I'd like to be able to "import" the server's database read/write methods into a module in the application, possibly driven by a reactor of some sort. In this case, there'd be no client/server protocol, just calls from other modules in the application. I realize that this is pretty vague; I'm still in the process of conceptualizing it. I'm looking for any advice that might help avoid the all-too-obvious approach of copying code and performing surgery on it, with the all-too-well-known drawbacks. Thanks for any good words, -- Don Dwiggins Advanced Publishing Technology

On Jan 24, 2011, at 2:26 PM, Don Dwiggins wrote:
I have a server that provides access to a database in the usual way, using adbapi to talk to an MSSQL server. Now, I'm facing the need to create an application that can access the server directly. (In addition to, not instead of.)
Why do you need to "port twisted methods to a syncronous environment"? Why can't you just write your app asynchronously? -phil

On 1/24/2011 12:45 PM, Phil Christensen wrote:
On Jan 24, 2011, at 2:26 PM, Don Dwiggins wrote:
I have a server that provides access to a database in the usual way, using adbapi to talk to an MSSQL server. Now, I'm facing the need to create an application that can access the server directly. (In addition to, not instead of.) Why do you need to "port twisted methods to a syncronous environment"? Why can't you just write your app asynchronously?
Well, yes, the message subject is a bit misleading. I was trying to think of a way that the async methods in the server could be imported directly into the app. I later remembered a Wiki page on integrating Twisted's reactor into a wx app; I think that'll give me what I need. -- Don Dwiggins Advanced Publishing Technology
participants (2)
-
Don Dwiggins
-
Phil Christensen