ActionScheduler_OptionLock::set( string $lock_type )
Set a lock using options for a given amount of time (60 seconds by default).
Description Description
Using an autoloaded option avoids running database queries or other resource intensive tasks on frequently triggered hooks, like ‘init’ or ‘shutdown’.
For example, ActionScheduler_QueueRunner->maybe_dispatch_async_request() uses a lock to avoid calling ActionScheduler_QueueRunner->has_maximum_concurrent_batches() every time the ‘shutdown’, hook is triggered, because that method calls ActionScheduler_QueueRunner->store->get_claim_count() to find the current number of claims in the database.
Parameters Parameters
- $lock_type
-
(Required) A string to identify different lock types.
Source Source
File: packages/action-scheduler/classes/ActionScheduler_OptionLock.php