diff --git a/example/thread.php b/example/thread.php index 8835610..565194b 100755 --- a/example/thread.php +++ b/example/thread.php @@ -6,7 +6,7 @@ use Amp\Parallel\Threading\Thread; use Amp\Pause; use AsyncInterop\Loop; -Loop::execute(function () { +Loop::execute(Amp\wrap(function () { $timer = Loop::repeat(1000, function () { static $i; $i = $i ? ++$i : 1; @@ -41,4 +41,4 @@ Loop::execute(function () { } finally { Loop::cancel($timer); } -}); +})); diff --git a/example/worker-pool.php b/example/worker-pool.php index c66a046..096b939 100755 --- a/example/worker-pool.php +++ b/example/worker-pool.php @@ -2,9 +2,8 @@ start(); $coroutines = []; diff --git a/example/worker.php b/example/worker.php index 2843f94..2aeccf3 100755 --- a/example/worker.php +++ b/example/worker.php @@ -4,8 +4,9 @@ require dirname(__DIR__).'/vendor/autoload.php'; use Amp\Parallel\Worker\DefaultWorkerFactory; use Amp\Parallel\Example\BlockingTask; +use AsyncInterop\Loop; -Amp\execute(function () { +Loop::execute(Amp\wrap(function () { $factory = new DefaultWorkerFactory(); $worker = $factory->create(); @@ -16,4 +17,4 @@ Amp\execute(function () { $code = yield $worker->shutdown(); printf("Code: %d\n", $code); -}); +}));