Part of twisted.internet.task View Source
Call main and run the reactor until the Deferred it
returns fires.
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 reactor.run
directly, as this function will also:
reactor.stop once and only once, and at
the right time.
Deferred returned by
main.
main fails with a
SystemExit error, the code returned is used.
| Parameters | main | A callable which returns a Deferred. It
should take as many arguments as there are elements in the list
argv. |
| argv | A list of arguments to pass to main. | |
| _reactor | An implementation detail to allow easier unit testing. Do not supply this parameter. | |
| Present Since | 12.3 | |