twisted.internet.task.react(main, argv=(), _reactor=None)function documentation
main and run the reactor until the
This is intended as the way to start up an application with a
well-defined completion condition. Use it to write clients or one-off
asynchronous operations. Prefer this to calling
directly, as this function will also:
reactor.stoponce and only once, and at the right time.
mainfails with a
SystemExiterror, the code returned is used.
The following demonstrates the signature of a
which can be used with
def main(reactor, username, password): return defer.succeed('ok') task.react(main, ('alice', 'secret'))
|Parameters||main||A callable which returns a |
|argv||A list of arguments to pass to |
|_reactor||An implementation detail to allow easier unit testing. Do not supply this parameter.|