Tribe__Process__Queue::maybe_handle( array|null $data_source = null )

Maybe handle the process request in async or sync mode depending on the supported mode.


Parameters

$data_source

(array|null) (Optional) An optional data source.

Default value: null


Top ↑

Source

File: src/Tribe/Process/Queue.php

	public function maybe_handle() {
		if ( $this->feature_detection->supports_async_process() ) {
			parent::maybe_handle();
		}

		// Don't lock up other requests while processing
		session_write_close();

		if ( $this->is_process_running() ) {
			// Background process already running.
			return;
		}

		if ( $this->is_queue_empty() ) {
			// No data to process.
			return;
		}

		$this->handle();

		return null;
	}

Top ↑

Changelog

Changelog
Version Description
4.9.5 Introduced.