<?php

class Facet_Wp_Remote_Data_Background_Process_Handler {

	protected $background_process;

	public function init() {
		$this->background_process = new Facet_Wp_Remote_Data_Background_Process();

		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) return;

		if (
			$this->background_process->is_queued()
			&& ! $this->background_process->is_processing()
		) {
			$this->background_process->dispatch();
		}
	}

}