xp_high_priority

xp_high_priority($process)

Creates or sets a process to have a high priority.

Processes with a high priority will be executed before those with a low or default priority.

This will register the priority as 0 as priority goes in ascending order.

Note

Interruptions will be executed before high priority processes.

Parameters:callable|process – PHP Callable or XPSPLProcess.
Return type:object Process

Example #1 Basic Usage

Basic usage example demonstrating high priority processes.

<?php

// Register a process on the foo signal
xp_signal(XP_SIG('foo'), function(){
    echo 'bar';
});

// Register another process with high priority
xp_signal(XP_SIG('foo'), xp_high_priority(function(){
    echo 'foo';
}));

The above code will output.

foobar
Read the Docs v: v5.0.1
Versions
latest
v5.0.1
v5.0.0
v4.0.1
v4.0.0
v3.1.1
v3.1.0
v3.0.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.