PHP code example of marko / queue
1. Go to this page and download the library: Download marko/queue library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marko / queue example snippets
use Marko\Queue\Job;
use Marko\Queue\QueueInterface;
class SendWelcomeEmail extends Job
{
public function __construct(
private readonly string $email,
) {}
public function handle(): void
{
// Send the email...
}
}
// Dispatch via QueueInterface
$queue->push(new SendWelcomeEmail('[email protected]'));