[Twisted-Python] runReactor tests vs. t.i.task.cooperate and other users of the global reactor
Deep within the bowels of the new TLS code, cooperate() is used. Unfortunately, that uses the global reactor... which means it breaks in tests that create a new reactor instance. Should I just change the new TLS code to take in a reactor instance and pass it everywhere? Or, as part of the test framework, have runReactor override the global reactor instance? -Itamar
Gut feeling says change the new TLS code to take in a reactor instance and pass it everywhere.
On Jul 26, 2011, at 8:57 AM, Laurens Van Houtven wrote:
Gut feeling says change the new TLS code to take in a reactor instance and pass it everywhere.
I agree. Passing parameters explicitly is the way to go. Especially in the new TLS code, whose primary benefit is the sterner separation of concerns between TLS and reactor socket shenanigans.
participants (3)
-
Glyph Lefkowitz
-
Itamar Turner-Trauring
-
Laurens Van Houtven