lib/Helper.php
protected static function handle_transient_locking( $slug, $callback, $transient_time, $lock_timeout, $force, $enable_transients ) {
		if ( $enable_transients && self::_is_transient_locked($slug) ) {
			$force = apply_filters('timber_force_transients', $force);
			$force = apply_filters('timber_force_transient_'.$slug, $force);
			if ( !$force ) {
				//the server is currently executing the process.
				//We're just gonna dump these users. Sorry!
				return false;
			}
			$enable_transients = false;
		}
		// lock timeout shouldn't be higher than 5 seconds, unless
		// remote calls with high timeouts are made here
		if ( $enable_transients ) {
			self::_lock_transient($slug, $lock_timeout);
		}
		$data = $callback();
		if ( $enable_transients ) {
			set_transient($slug, $data, $transient_time);
			self::_unlock_transient($slug);
		}
		return $data;
	}
protected static function handle_transient_locking( $slug, $callback, $transient_time, $lock_timeout, $force, $enable_transients ) {
		if ( $enable_transients && self::_is_transient_locked($slug) ) {
			$force = apply_filters('timber_force_transients', $force);
			$force = apply_filters('timber_force_transient_'.$slug, $force);
			if ( !$force ) {
				//the server is currently executing the process.
				//We're just gonna dump these users. Sorry!
				return false;
			}
			$enable_transients = false;
		}
		// lock timeout shouldn't be higher than 5 seconds, unless
		// remote calls with high timeouts are made here
		if ( $enable_transients ) {
			self::_lock_transient($slug, $lock_timeout);
		}
		$data = $callback();
		if ( $enable_transients ) {
			set_transient($slug, $data, $transient_time);
			self::_unlock_transient($slug);
		}
		return $data;
	}
protected static function handle_transient_locking ( $ slug , $ callback , $ transient_time , $ lock_timeout , $ force , $ enable_transients ) { if ( $ enable_transients && self :: _is_transient_locked ( $ slug ) ) { $ force = apply_filters ( 'timber_force_transients' , $ force ) ; $ force = apply_filters ( 'timber_force_transient_' . $ slug , $ force ) ; if ( ! $ force ) { //the server is currently executing the process. //We're just gonna dump these users. Sorry! return false ; } $ enable_transients = false ; } // lock timeout shouldn't be higher than 5 seconds, unless // remote calls with high timeouts are made here if ( $ enable_transients ) { self :: _lock_transient ( $ slug , $ lock_timeout ) ; } $ data = $ callback ( ) ; if ( $ enable_transients ) { set_transient ( $ slug , $ data , $ transient_time ) ; self :: _unlock_transient ( $ slug ) ; } return $ data ; }
Does the dirty work of locking the transient, running the callback and unlocking
@param string 	$slug
@param callable 	$callback
@param integer  	$transient_time Expiration of transients in seconds
@param integer 	$lock_timeout   How long (in seconds) to lock the transient to prevent race conditions
@param boolean 	$force          Force callback to be executed when transient is locked
@param boolean 	$enable_transients Force callback to be executed when transient is locked
Does the dirty work of locking the transient running the callback and unlocking