[Twisted-Python] CFReactor redux
It's been awhile since this was brought up on the mailing list, but I'd like to see if anyone has any real interest in using Twisted with Cocoa on Mac OS X. It was suggested to me that one thing that was needed was a reactor based on ThreadedSelectReactor that would integrate with the Cocoa runtime. I've posted my results here: http://twistedmatrix.com/trac/ticket/1833 This class is extremely trivial, but it makes working with PyObjC/ Twisted apps a bit more straightforward. However, there are significant issues with the entire TSR approach. The primary one is that it's impossible to do any Trial testing, because as far as I can tell, it is impossible to make the CFReactor's run() method return without terminating the entire process. I have a couple questions for the group, namely: 1.) Does anyone with a better grasp of Cocoa/PyObjC development have any ideas on how a suitable reactor might be implemented? 2.) Is there any way to run the unit tests without restarting the reactor between each test? I'm sure this would cause many tests to fail, but at least we'd be able to see if there was any other major issues. I'm not suggesting any changes be made to trial. I'm just looking for any possible way to run the tests manually. 3.) Will anyone use this? I know the core devs are generally uninterested in supporting a Cocoa reactor, but I'm glad to maintain this if it would be used. -phil
2007/10/23, Phil Christensen
It's been awhile since this was brought up on the mailing list, but I'd like to see if anyone has any real interest in using Twisted with Cocoa on Mac OS X.
(snip)
3.) Will anyone use this? I know the core devs are generally uninterested in supporting a Cocoa reactor, but I'm glad to maintain this if it would be used.
+1 AFAIAC, I don't actually need a Cocoa reactor *right now*, but I know for sure that if it exists I might use it in the next few months. And it's probably true for a lot of other Twisted users : they won't use/need a Cocoa reactor until it exists. You know, as often happens, offer creates demand. So, if you're willing to maintain such a peace of software, please do ! :)
It was suggested to me that one thing that was needed was a reactor based on ThreadedSelectReactor that would integrate with the Cocoa runtime.
Didn't Bob Ippolito already do this? <http://bob.pythonmac.org/ archives/2005/04/17/twisted-and-foreign-event-loops/> -- http://artins.org/ben "Clue meter is reading zero." -- Alice
On Oct 24, 2007, at 5:26 AM, Ben Artin wrote:
It was suggested to me that one thing that was needed was a reactor based on ThreadedSelectReactor that would integrate with the Cocoa runtime.
Didn't Bob Ippolito already do this? <http://bob.pythonmac.org/ archives/2005/04/17/twisted-and-foreign-event-loops/>
Yeah, essentially, but it's complicated. That post refers to TSR, which is almost, but not quite, a complete reactor. That's why it's been moved to _threadedselectreactor.py. As I understand it, TSR is intended to be the foundation for any reactor that needs to integrate with a foreign event loop. The wxreactor is a TSR subclass that wraps up the wx-specific details into a convenience class. cfreactor2 was meant to be like this, but it suffers from the same issue wxreactor does, in that the reactor cannot be stopped and restarted. Technically, reactors aren't supposed to support this, but Trial requires the functionality for testing. -phil
participants (3)
-
Ben Artin
-
Phil Christensen
-
Yoann Aubineau