Skip to content

Commit

Permalink
Feat: Granting access to the underlying server
Browse files Browse the repository at this point in the history
  • Loading branch information
byawitz committed Jul 25, 2024
1 parent f355e93 commit 4c55e3b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Http/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
abstract class Adapter
{
abstract public function onStart(callable $callback);

abstract public function onRequest(callable $callback);

abstract public function start();

abstract public function getServer(): mixed;
}
5 changes: 5 additions & 0 deletions src/Http/Adapter/FPM/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ public function start()
{
return;
}

public function getServer(): mixed
{
return null;
}
}
5 changes: 5 additions & 0 deletions src/Http/Adapter/Swoole/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ public function start()
Runtime::enableCoroutine();
return $this->server->start();
}

public function getServer(): mixed
{
return $this->server;
}
}
5 changes: 5 additions & 0 deletions src/Http/Adapter/SwooleCoroutine/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ public function start()
$this->server->start();
});
}

public function getServer(): mixed
{
return $this->server;
}
}

0 comments on commit 4c55e3b

Please sign in to comment.