Skip to content

Commit 1e4093a

Browse files
committed
a few attempts to find a memory leak
1 parent f51ee57 commit 1e4093a

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

src/AsyncBridge.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ class AsyncBridge
3131
*/
3232
public function __construct(Engine $app)
3333
{
34-
35-
// Makes it so the app doesn't stop when it runs.
36-
$app->map('stop', function (?int $code = null) use ($app) {
37-
if ($code !== null) {
38-
$app->response()->status($code);
39-
}
40-
});
4134
$this->app = $app;
4235
}
4336

tests/swoole/SwooleServerDriver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function bindHttpEvent() {
5959
});
6060

6161
$this->Swoole->on('Request', function (SwooleRequest $request, SwooleResponse $response) use ($AsyncBridge) {
62-
62+
echo memory_get_peak_usage() . PHP_EOL;
6363
// $pool1 = $this->getConnectionPool('mysql');
6464
// // /**@var MySQL $mysql */
6565
// $pdo = $pool1->borrow();
@@ -89,7 +89,6 @@ protected function bindHttpEvent() {
8989
// $Engine->register('response', 'flight\net\Response');
9090
// $Engine->register('request', 'flight\net\Request');
9191

92-
9392
$SwooleAsyncRequest = new SwooleAsyncRequest($request);
9493
$SwooleAsyncResponse = new SwooleAsyncResponse($response);
9594
$AsyncBridge->processRequest($SwooleAsyncRequest, $SwooleAsyncResponse);

tests/swoole/swoole_server.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
echo '<h1>Test</h1>';
3030
});
3131

32+
// Makes it so the app doesn't stop when it runs.
33+
$app->map('stop', function (?int $code = null) use ($app) {
34+
if ($code !== null) {
35+
$app->response()->status($code);
36+
}
37+
});
38+
3239
if(!defined("NOT_SWOOLE")) {
3340
// $app->map('stop', function() use ($app) {
3441
// $response = $app->response();

0 commit comments

Comments
 (0)