We are using Thruway as an asynchronous as well a synchronous client. In case of using a synchronous client we are facing a problem when memory leaks all the time. The following code is not from real project and does nothing useful (just open and close connection) but it can show the essence of the problem.
<?php
require_once('../../vendor/autoload.php');
use Thruway\ClientSession;
use Thruway\Connection;
while(1){
usleep(10000);
$connection = new Connection(["realm" => 'realm1', "url" => 'ws://127.0.0.1:8080/']);
$connection->on('open', function (ClientSession $session) use ($connection) {
$connection->close();
}
);
$connection->open();
}
$connection = null; and unset($connection) don't help.
We are not using event and ev php extension, just default built-in php library. We are using php 7.2 inside of Ubuntu virtual mashine using Vagrant.
The problem above seems pretty similar to one for Ratchet described in https://github.com/ratchetphp/Ratchet/issues/662. I have tried it in hope it can help as Ratchet is under the hood of Thruway, but the proposed solution did not work.
We are using Thruway as an asynchronous as well a synchronous client. In case of using a synchronous client we are facing a problem when memory leaks all the time. The following code is not from real project and does nothing useful (just open and close connection) but it can show the essence of the problem.
$connection = null; and unset($connection) don't help.
We are not using event and ev php extension, just default built-in php library. We are using php 7.2 inside of Ubuntu virtual mashine using Vagrant.
The problem above seems pretty similar to one for Ratchet described in https://github.com/ratchetphp/Ratchet/issues/662. I have tried it in hope it can help as Ratchet is under the hood of Thruway, but the proposed solution did not work.