Skip to content

Commit

Permalink
- Fixing react loop implementation
Browse files Browse the repository at this point in the history
- Dropping kdyby/console
  • Loading branch information
akadlec committed Nov 9, 2019
1 parent 354fad7 commit a3854ae
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
21 changes: 21 additions & 0 deletions .travis.composer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$version = getenv('NETTE');

if (!$version || $version == 'default') {
exit;
}

echo "Nette version " . $version . PHP_EOL;

$file = __DIR__ . '/composer.json';

$content = file_get_contents($file);

$composer = json_decode($content, TRUE);

$composer['require']['nette/di'] = $version;

$content = json_encode($composer);

file_put_contents($file, $content);
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ before_install:
- composer self-update

before_script:
- php .travis.composer.php
- composer install --no-interaction --prefer-source --dev

script:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

"psr/log" : "~1.0",

"kdyby/console" : "~2.7"
"contributte/console" : "~0.5 || ~0.7"
},

"require-dev" : {
Expand Down
6 changes: 3 additions & 3 deletions src/IPub/MQTTClient/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ private function handleSend() : void

if ($flow !== NULL) {
if ($flow->isFinished()) {
$this->loop->nextTick(function () use ($flow) {
$this->loop->futureTick(function () use ($flow) {
$this->finishFlow($flow);
});

Expand Down Expand Up @@ -730,7 +730,7 @@ private function startFlow(Mqtt\Flow $flow, bool $isSilent = FALSE) : Promise\Ex
}

} else {
$this->loop->nextTick(function () use ($internalFlow) {
$this->loop->futureTick(function () use ($internalFlow) {
$this->finishFlow($internalFlow);
});
}
Expand Down Expand Up @@ -769,7 +769,7 @@ private function continueFlow(Flow\Envelope $flow, Mqtt\Packet $packet) : void
}

} elseif ($flow->isFinished()) {
$this->loop->nextTick(function () use ($flow) {
$this->loop->futureTick(function () use ($flow) {
$this->finishFlow($flow);
});
}
Expand Down
12 changes: 11 additions & 1 deletion tests/IPubTests/MQTTClient/files/config.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
extensions:
console : Kdyby\Console\DI\ConsoleExtension
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
mqttClient : IPub\MQTTClient\DI\MQTTClientExtension

console:
name: iPublikuj:Packages!
version: '1.0'
catchExceptions: true
autoExit: true
url: http://example.com
lazy: false
helperSet: \Symfony\Component\Console\Helper\HelperSet
helpers: []

0 comments on commit a3854ae

Please sign in to comment.