[Twisted-Python] Is it a good/recommended practice to pass Instance Method into reactor.callFromThread()/callInThread()?

Jan. 23, 2007
7:16 a.m.
Hi Twisted Guru, I'm new to Twisted, I am just experimenting Twisted 2.5 with Python 2.5. It seems that I can pass either a python function or a python object instance method to reactor.callInThread() for blocking operation and reactor.callFromThread() in main event loop. I just want to see whether it is a good/recommended practice to pass Instance Method into reactor.callFromThread()/callInThread(), which implies that the application level context information stored in the python object instance is available when the method is invoked, so I don't have to pass all the context info as parameters. Do I miss anything in Twisted? Any suggestion or tip is really appreciated. Thanks a lot for your help! Jian
6624
Age (days ago)
6625
Last active (days ago)
2 comments
2 participants
participants (2)
-
Andrew Bennetts
-
jian wu