Skip to content

Commit

Permalink
some adjustments for open handles
Browse files Browse the repository at this point in the history
  • Loading branch information
ata-no-one committed Nov 8, 2024
1 parent 1dff12d commit 0f6afbb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion php/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"phpunit.phpunit": "/workspaces/vaas/php/tests/vaas/vendor/bin/phpunit",
"phpunit.php": "/usr/local/bin/php",
"php.debug.ideKey": "vsc",
"php.debug.executablePath": "/usr/local/bin/php"
"php.debug.executablePath": "/usr/local/bin/php",
"php.suggest.basic": false
}
1 change: 1 addition & 0 deletions php/examples/VaasExample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
files/*
6 changes: 5 additions & 1 deletion php/src/vaas/Vaas.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,18 @@ public function ForFile(string $path, $upload = true, string $uuid = null): Vaas
$fileStream = \Amp\File\openFile($path, 'r');
$fileSize = \filesize($path);

return new VaasVerdict(
$verdict = new VaasVerdict(
$this->UploadStream(
$fileStream,
$verdictResponse->url,
$verdictResponse->upload_token,
$fileSize,
$verdictResponse->guid)
);

$fileStream->close();

return $verdict;
}

return new VaasVerdict($verdictResponse);
Expand Down
4 changes: 4 additions & 0 deletions php/src/vaas/VaasConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public function GetResponse($requestId): DeferredFuture {
return $future;
}

public function RemoveResponse($requestId): void {
$this->responses->delete($requestId);
}

public function GetConnectedWebsocket(): WebsocketConnection
{
if (!isset($this->WebSocketClient)) {
Expand Down

0 comments on commit 0f6afbb

Please sign in to comment.