Skip to content

Commit af2e0c2

Browse files
authored
Update Ydb.php
grpc timeout
1 parent e479cc7 commit af2e0c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Ydb.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class Ydb
4242
*/
4343
protected $grpc_config;
4444

45+
/**
46+
* @var int|null
47+
*/
48+
protected $grpcTimeout;
49+
4550
/**
4651
* @var Iam
4752
*/
@@ -112,6 +117,7 @@ public function __construct($config = [], LoggerInterface $logger = null)
112117
$this->database = $config['database'] ?? null;
113118
$this->iam_config = $config['iam_config'] ?? [];
114119
$this->grpc_config = (array) ($config['grpc'] ?? []);
120+
$this->grpcTimeout = $config['grpc']['timeout'] ?? null;
115121

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

196+
/**
197+
* Get gRPC timeout in microseconds
198+
*
199+
* @return int|null
200+
*/
201+
public function getGrpcTimeout()
202+
{
203+
return $this->grpcTimeout;
204+
}
205+
190206
/**
191207
* Discover available endpoints to connect to.
192208
*

0 commit comments

Comments
 (0)