Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Ydb.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class Ydb
*/
protected $grpc_config;

/**
* @var int|null
*/
protected $grpcTimeout;

/**
* @var Iam
*/
Expand Down Expand Up @@ -112,6 +117,7 @@ public function __construct($config = [], LoggerInterface $logger = null)
$this->database = $config['database'] ?? null;
$this->iam_config = $config['iam_config'] ?? [];
$this->grpc_config = (array) ($config['grpc'] ?? []);
$this->grpcTimeout = $config['grpc']['timeout'] ?? null;

if (!is_null($logger) && isset($config['logger'])){
throw new \Exception('Logger set in 2 places');
Expand Down Expand Up @@ -187,6 +193,16 @@ public function grpcOpts(): array
return $grpcOpts;
}

/**
* Get gRPC timeout in microseconds
*
* @return int|null
*/
public function getGrpcTimeout()
{
return $this->grpcTimeout;
}

/**
* Discover available endpoints to connect to.
*
Expand Down