Skip to content

Instantly share code, notes, and snippets.

View davidwdan's full-sized avatar

David Dan davidwdan

View GitHub Profile
<?php
require_once __DIR__ . '/../bootstrap.php';
// Bootstrap the scheduler once in your project
\Rx\Scheduler::setDefaultFactory(function () {
return new \Rx\Scheduler\EventLoopScheduler(function ($ms, callable $callable) {
$timerId = $ms === 0 ? \Swoole\Event::defer($callable) : \Swoole\Timer::after($ms, $callable);