Hi,
can I call a reactphp promise twice? I tried and it seems to work just fine, I was just wondering if there is any drawback doing it. Here an example with reactphp-buzz client:
use Clue\React\Buzz\Browser;
use Exception;
use Psr\Http\Message\ResponseInterface;
use React\EventLoop\Factory;
$loop = Factory::create();
$browser = new Browser($loop);
$promise = $browser->get('https://google.it');
$promise->then(
function (ResponseInterface $response) {
var_dump('Response received', $response);
},
function (Exception $error) {
var_dump('There was an error', $error->getMessage());
}
);
$promise->then(
function (ResponseInterface $response) {
var_dump('Response received', $response);
},
function (Exception $error) {
var_dump('There was an error', $error->getMessage());
}
);
$loop->run();
Hey @cheeghi sure you can do that, infact this is by design. The catch however is that if you do this your application needs to be know you're doing this and it has to be by design.
Hi, can I call a reactphp promise twice? I tried and it seems to work just fine, I was just wondering if there is any drawback doing it. Here an example with reactphp-buzz client:
Thank you in advance.