Skip to content

Instantly share code, notes, and snippets.

View jsor's full-sized avatar
💨

Jan Sorgalla jsor

💨
View GitHub Profile
@jsor
jsor / gist:b77fe49e08b8c9ffb7e9
Last active December 17, 2015 09:36
ReactPHP needs improving, any ideas?
<?php
namespace App\ProcessManager\Billing;
use App\Read\Billing\Queries\GetDefaultPlan;
use App\Read\Identity\Queries\UserWithId;
use App\Read\Identity\UserDto;
use App\Services\Bus\BillingCommandBus;
use App\Services\Bus\BillingQueryBus;
use App\Services\Bus\IdentityQueryBus;
@jsor
jsor / test.php
Last active August 29, 2015 14:06 — forked from anonymous/test.php
<?php
require 'vendor/autoload.php';
$loop = \React\EventLoop\Factory::create();
$filesystem = new \React\Filesystem\Filesystem($loop);
$loop->addTimer(0.0001, function() use ($filesystem) {
$file = $filesystem->file(__FILE__);
$file->exists()->then(function() use ($file) {
echo __FILE__ . ' exists', PHP_EOL;
@jsor
jsor / gist:4109766
Created November 19, 2012 09:14 — forked from igorw/gist:4108347
React v0.2.4 release notes

React v0.2.4 is more awesome

DNS promises

This release has two major improvements. The first one is that react/dns is now using a promise based API. In case you missed it, react/promise is a PHP library for promises. Take a look at the README and familiarize yourself with it, as it will be used by many libs in the react ecosystem, including core.

The previous API was:

$dns->resolve('igor.io', function ($ip) {

echo "Yay, the IP is $ip.\n";