lock time (60 seconds by default) * 3. haven't exceeded the number of allowed batches.
	 *
	 * The order of these checks is important, because they run from a check on a value:
	 * 1. in memory - is_admin() maps to $GLOBALS or the WP_ADMIN constant
	 * 2. in memory - transients use autoloaded options by default
	 * 3. from a database query - has_maximum_concurrent_batches() run the query
	 *    $this->store->get_claim_count() to find the current number of claims in the DB.
	 *
	 * If all of these conditions are met, then we request an async runner check whether it
	 * should dispatch a request to process pending actions.
	 */
	public function maybe_dispatch_async_request() {
		// Only start an async queue at most once every 60 seconds.
		if (
			is_admin()
			&& ! ActionScheduler::lock()->is_locked( 'async-request-runner' )
			&& ActionScheduler::lock()->set( 'async-request-runner' )
		) {
			$this->async_request->maybe_dispatch();
		}
	}

	/**
	 * Process actions in the queue. Attached to self::WP_CRON_HOOK i.e. 'action_scheduler_run_queue'
	 *
	 * The $context param of this method defaults to 'WP Cron', because prior to Action Scheduler 3.0.0
	 * that was the only context in which this method was run, and the self::WP_CRON_HOOK hook had no context
	 * passed along with it. New code calling this method directly, or by triggering the self::WP_CRON_HOOK,
	 * should set a context as the first parameter. For an example of this, refer to the code seen in
	 *
	 * @see ActionScheduler_AsyncRequest_QueueRunner::handle()
	 *
	 * @param string $context Optional identifier for the context in which this action is being processed, e.g. 'WP CLI' or 'WP Cron'
	 *        Generally, this should be capitalised and not localised as it's a proper noun. * @return int The number of actions processed. */ public function run($context='WP Cron'){ActionScheduler_Compatibility::raise_memory_limit();ActionScheduler_Compatibility::raise_time_limit($this->get_time_limit());do_action('action_scheduler_before_process_queue');$cleanup_time_limit=10 * $this->get_time_limit();// Backward compatibility:If the action cleaner is standard,cleaning will be performed as an action to improve throughput // and enable daily runs. If not,cleaning will occur explicitly before processing actions to ensure backward compatibility. if ($this->is_custom_cleaner){// Execute complete cleanup cycle,as in this logical branch deletion IS NOT executed via a separate action. $this->cleaner->clean($cleanup_time_limit)}else{// Execute partial cleanup cycle,as in this logical branch deletion IS executed via a separate action. $this->cleaner->reset_timeouts($cleanup_time_limit);$this->cleaner->mark_failures($cleanup_time_limit)}$this->processed_actions_count=0;if (false===$this->has_maximum_concurrent_batches()){$batch_size=apply_filters('action_scheduler_queue_runner_batch_size',25);// Note:gc_collect_cycles() was considered here and in do_batch/clear_caches,but rejected:// upside is speculative,GC sweep cost scales with object count and can cause pauses. do{$processed_actions_in_batch=$this->do_batch($batch_size,$context);$this->processed_actions_count+=$processed_actions_in_batch}while ($processed_actions_in_batch>0 && ! $this->batch_limits_exceeded($this->processed_actions_count));// keep going until we run out of actions,time,or memory.}do_action('action_scheduler_after_process_queue');return $this->processed_actions_count}protected function do_batch($size=100,$context=''){$claim=$this->store->stake_claim($size);$this->monitor->attach($claim);$processed_actions=0;$claim_id=$claim->get_id();foreach ($claim->get_actions() as $action_id){// Bail if we lost the claim. if ($claim_id !==$this->store->get_claim_id($action_id)){break}$this->process_action($action_id,$context);$processed_actions++;if ($this->batch_limits_exceeded($processed_actions+$this->processed_actions_count)){break}}$this->store->release_claim($claim);$this->monitor->detach();$this->clear_caches();return $processed_actions}protected function clear_caches(){$flushing_runtime_cache_explicitly_supported=function_exists('wp_cache_supports') && wp_cache_supports('flush_runtime');$flushing_runtime_cache_implicitly_supported=! function_exists('wp_cache_supports') && function_exists('wp_cache_flush_runtime');if ($flushing_runtime_cache_explicitly_supported || $flushing_runtime_cache_implicitly_supported){wp_cache_flush_runtime()}elseif (! wp_using_ext_object_cache() || apply_filters('action_scheduler_queue_runner_flush_cache',false)){wp_cache_flush()}}public function add_wp_cron_schedule($schedules){$schedules['every_minute']=array('interval'=>60,// in seconds. 'display'=>__('Every minute','woocommerce'),);return $schedules}}