TopicServiceClient.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. // GENERATED CODE -- DO NOT EDIT!
  3. namespace Ydb\Topic\V1;
  4. /**
  5. */
  6. class TopicServiceClient extends \Grpc\BaseStub {
  7. /**
  8. * @param string $hostname hostname
  9. * @param array $opts channel options
  10. * @param \Grpc\Channel $channel (optional) re-use channel object
  11. */
  12. public function __construct($hostname, $opts, $channel = null) {
  13. parent::__construct($hostname, $opts, $channel);
  14. }
  15. /**
  16. * Create Write Session
  17. * Pipeline example:
  18. * client server
  19. * InitRequest(Topic, MessageGroupID, ...)
  20. * ---------------->
  21. * InitResponse(Partition, MaxSeqNo, ...)
  22. * <----------------
  23. * WriteRequest(data1, seqNo1)
  24. * ---------------->
  25. * WriteRequest(data2, seqNo2)
  26. * ---------------->
  27. * WriteResponse(seqNo1, offset1, ...)
  28. * <----------------
  29. * WriteRequest(data3, seqNo3)
  30. * ---------------->
  31. * WriteResponse(seqNo2, offset2, ...)
  32. * <----------------
  33. * [something went wrong] (status != SUCCESS, issues not empty)
  34. * <----------------
  35. * @param array $metadata metadata
  36. * @param array $options call options
  37. * @return \Grpc\BidiStreamingCall
  38. */
  39. public function StreamWrite($metadata = [], $options = []) {
  40. return $this->_bidiRequest('/Ydb.Topic.V1.TopicService/StreamWrite',
  41. ['\Ydb\Topic\StreamWriteMessage\FromServer','decode'],
  42. $metadata, $options);
  43. }
  44. /**
  45. * Create Read Session
  46. * Pipeline:
  47. * client server
  48. * InitRequest(Topics, ClientId, ...)
  49. * ---------------->
  50. * InitResponse(SessionId)
  51. * <----------------
  52. * ReadRequest
  53. * ---------------->
  54. * ReadRequest
  55. * ---------------->
  56. * StartPartitionSessionRequest(Topic1, Partition1, PartitionSessionID1, ...)
  57. * <----------------
  58. * StartPartitionSessionRequest(Topic2, Partition2, PartitionSessionID2, ...)
  59. * <----------------
  60. * StartPartitionSessionResponse(PartitionSessionID1, ...)
  61. * client must respond with this message to actually start recieving data messages from this partition
  62. * ---------------->
  63. * StopPartitionSessionRequest(PartitionSessionID1, ...)
  64. * <----------------
  65. * StopPartitionSessionResponse(PartitionSessionID1, ...)
  66. * only after this response server will give this parittion to other session.
  67. * ---------------->
  68. * StartPartitionSessionResponse(PartitionSession2, ...)
  69. * ---------------->
  70. * ReadResponse(data, ...)
  71. * <----------------
  72. * CommitRequest(PartitionCommit1, ...)
  73. * ---------------->
  74. * CommitResponse(PartitionCommitAck1, ...)
  75. * <----------------
  76. * [something went wrong] (status != SUCCESS, issues not empty)
  77. * <----------------
  78. * @param array $metadata metadata
  79. * @param array $options call options
  80. * @return \Grpc\BidiStreamingCall
  81. */
  82. public function StreamRead($metadata = [], $options = []) {
  83. return $this->_bidiRequest('/Ydb.Topic.V1.TopicService/StreamRead',
  84. ['\Ydb\Topic\StreamReadMessage\FromServer','decode'],
  85. $metadata, $options);
  86. }
  87. /**
  88. * Create topic command.
  89. * @param \Ydb\Topic\CreateTopicRequest $argument input argument
  90. * @param array $metadata metadata
  91. * @param array $options call options
  92. * @return \Grpc\UnaryCall
  93. */
  94. public function CreateTopic(\Ydb\Topic\CreateTopicRequest $argument,
  95. $metadata = [], $options = []) {
  96. return $this->_simpleRequest('/Ydb.Topic.V1.TopicService/CreateTopic',
  97. $argument,
  98. ['\Ydb\Topic\CreateTopicResponse', 'decode'],
  99. $metadata, $options);
  100. }
  101. /**
  102. * Describe topic command.
  103. * @param \Ydb\Topic\DescribeTopicRequest $argument input argument
  104. * @param array $metadata metadata
  105. * @param array $options call options
  106. * @return \Grpc\UnaryCall
  107. */
  108. public function DescribeTopic(\Ydb\Topic\DescribeTopicRequest $argument,
  109. $metadata = [], $options = []) {
  110. return $this->_simpleRequest('/Ydb.Topic.V1.TopicService/DescribeTopic',
  111. $argument,
  112. ['\Ydb\Topic\DescribeTopicResponse', 'decode'],
  113. $metadata, $options);
  114. }
  115. /**
  116. * Describe topic's consumer command.
  117. * @param \Ydb\Topic\DescribeConsumerRequest $argument input argument
  118. * @param array $metadata metadata
  119. * @param array $options call options
  120. * @return \Grpc\UnaryCall
  121. */
  122. public function DescribeConsumer(\Ydb\Topic\DescribeConsumerRequest $argument,
  123. $metadata = [], $options = []) {
  124. return $this->_simpleRequest('/Ydb.Topic.V1.TopicService/DescribeConsumer',
  125. $argument,
  126. ['\Ydb\Topic\DescribeConsumerResponse', 'decode'],
  127. $metadata, $options);
  128. }
  129. /**
  130. * Alter topic command.
  131. * @param \Ydb\Topic\AlterTopicRequest $argument input argument
  132. * @param array $metadata metadata
  133. * @param array $options call options
  134. * @return \Grpc\UnaryCall
  135. */
  136. public function AlterTopic(\Ydb\Topic\AlterTopicRequest $argument,
  137. $metadata = [], $options = []) {
  138. return $this->_simpleRequest('/Ydb.Topic.V1.TopicService/AlterTopic',
  139. $argument,
  140. ['\Ydb\Topic\AlterTopicResponse', 'decode'],
  141. $metadata, $options);
  142. }
  143. /**
  144. * Drop topic command.
  145. * @param \Ydb\Topic\DropTopicRequest $argument input argument
  146. * @param array $metadata metadata
  147. * @param array $options call options
  148. * @return \Grpc\UnaryCall
  149. */
  150. public function DropTopic(\Ydb\Topic\DropTopicRequest $argument,
  151. $metadata = [], $options = []) {
  152. return $this->_simpleRequest('/Ydb.Topic.V1.TopicService/DropTopic',
  153. $argument,
  154. ['\Ydb\Topic\DropTopicResponse', 'decode'],
  155. $metadata, $options);
  156. }
  157. }