php8.5
Home/ Manual/ sync / syncevent/ SyncEvent::fire

SyncEvent::fire

PHP function Edit on GitHub ✎

(PECL sync >= 1.0.0)

Fires/sets the event

Description

SyncEvent::fire(): bool

Fires/sets a SyncEvent object. Lets multiple threads through that are waiting if the event object was created with a manual value of true.

Parameters Parameters

Return Values

Success

Examples

SyncEvent::fire() example

php
<?php
// In a web application:
$event = new SyncEvent("GetAppReport");
$event->fire();

// In a cron job:
$event = new SyncEvent("GetAppReport");
$event->wait();
?>

See Also

  • SyncEvent::reset
  • SyncEvent::wait

Source: reference/sync/syncevent/fire.xml · from the official PHP manual (php/doc-en)