Invoke a function that may or may not return a Deferred.

Call the given function with the given arguments. If the returned object is a Deferred, return it. If the returned object is a Failure, wrap it with fail and return it. Otherwise, wrap it in succeed and return it. If an exception is raised, convert it to a Failure, wrap it in fail, and then return it.

ParametersfThe callable to invoke (type: Any callable)
argsThe arguments to pass to f
kwThe keyword arguments to pass to f
ReturnsThe result of the function call, wrapped in a Deferred if necessary. (type: Deferred)
API Documentation for Twisted, generated by pydoctor at 2019-08-06 12:10:50.