I have a chunk of PHP code which should not be run if the script is being executed from a task.
We already have these methods, which are similar to what I'm looking for:
craft()->isConsole()- Whether the script is running in the console.
craft()->request->isCpRequest()- Whether the script is running in the CP.
Is there a way to tell if the script is running inside of a task?
(Since my research has turned up nothing so far, I opened a related feature request...)