Skip to content

Instantly share code, notes, and snippets.

@jsor
Created May 5, 2015 14:29
Show Gist options
  • Save jsor/52bde3f82014e3898758 to your computer and use it in GitHub Desktop.
Save jsor/52bde3f82014e3898758 to your computer and use it in GitHub Desktop.
ReactLoopQueue
<?php
namespace React\Promise\Queue;
use React\EventLoop\LoopInterface;
class ReactLoopQueue implements QueueInterface
{
private $loop;
public function __construct(LoopInterface $loop)
{
$this->loop = $loop;
}
public function enqueue(callable $task)
{
$this->loop->nextTick($task);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment