original_string: public static function run_all_adhoc_tasks() {
          $now = time();
          while (($task = \core\task\manager::get_next_adhoc_task($now)) !== null) {
              try {
                  $task->execute();
                  \core\task\manager::adhoc_task_complete($task);
              } catch (Exception $e) {
                  \core\task\manager::adhoc_task_failed($task);
              }
          }
      }
code: public static function run_all_adhoc_tasks() {
          $now = time();
          while (($task = \core\task\manager::get_next_adhoc_task($now)) !== null) {
              try {
                  $task->execute();
                  \core\task\manager::adhoc_task_complete($task);
              } catch (Exception $e) {
                  \core\task\manager::adhoc_task_failed($task);
              }
          }
      }
code_tokens: public static function run_all_adhoc_tasks ( ) { $ now = time ( ) ; while ( ( $ task = \ core \ task \ manager :: get_next_adhoc_task ( $ now ) ) !== null ) { try { $ task -> execute ( ) ; \ core \ task \ manager :: adhoc_task_complete ( $ task ) ; } catch ( Exception $ e ) { \ core \ task \ manager :: adhoc_task_failed ( $ task ) ; } } }
docstring: Executes all adhoc tasks in the queue. Useful for testing asynchronous behaviour.
  
  @return void
docstring_tokens: Executes all adhoc tasks in the queue . Useful for testing asynchronous behaviour .