grpc.reflection.v1alpha.reflection.ServerReflectionClient.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pekko-grpc-runtime_3 Show documentation
Show all versions of pekko-grpc-runtime_3 Show documentation
Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams.
The newest version!
// Generated by Pekko gRPC. DO NOT EDIT.
package grpc.reflection.v1alpha.reflection
import scala.concurrent.ExecutionContext
import org.apache.pekko
import pekko.actor.ClassicActorSystemProvider
import pekko.grpc.GrpcChannel
import pekko.grpc.GrpcClientCloseException
import pekko.grpc.GrpcClientSettings
import pekko.grpc.scaladsl.PekkoGrpcClient
import pekko.grpc.internal.NettyClientUtils
import pekko.grpc.PekkoGrpcGenerated
import pekko.grpc.scaladsl.StreamResponseRequestBuilder
import pekko.grpc.internal.ScalaBidirectionalStreamingRequestBuilder
// Not sealed so users can extend to write their stubs
@PekkoGrpcGenerated
trait ServerReflectionClient extends ServerReflection with ServerReflectionClientPowerApi with PekkoGrpcClient
@PekkoGrpcGenerated
object ServerReflectionClient {
def apply(settings: GrpcClientSettings)(implicit sys: ClassicActorSystemProvider): ServerReflectionClient =
new DefaultServerReflectionClient(GrpcChannel(settings), isChannelOwned = true)
def apply(channel: GrpcChannel)(implicit sys: ClassicActorSystemProvider): ServerReflectionClient =
new DefaultServerReflectionClient(channel, isChannelOwned = false)
private class DefaultServerReflectionClient(channel: GrpcChannel, isChannelOwned: Boolean)(implicit sys: ClassicActorSystemProvider) extends ServerReflectionClient {
import ServerReflection.MethodDescriptors._
private implicit val ex: ExecutionContext = sys.classicSystem.dispatcher
private val settings = channel.settings
private val options = NettyClientUtils.callOptions(settings)
private def serverReflectionInfoRequestBuilder(channel: pekko.grpc.internal.InternalChannel) =
new ScalaBidirectionalStreamingRequestBuilder(serverReflectionInfoDescriptor, channel, options, settings)
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer serverReflectionInfo(org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionRequest, org.apache.pekko.NotUsed]) if possible.
*/
override def serverReflectionInfo(): StreamResponseRequestBuilder[org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionRequest, org.apache.pekko.NotUsed], grpc.reflection.v1alpha.reflection.ServerReflectionResponse] =
serverReflectionInfoRequestBuilder(channel.internalChannel)
/**
* For access to method metadata use the parameterless version of serverReflectionInfo
*/
def serverReflectionInfo(in: org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionRequest, org.apache.pekko.NotUsed]): org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionResponse, org.apache.pekko.NotUsed] =
serverReflectionInfo().invoke(in)
override def close(): scala.concurrent.Future[pekko.Done] =
if (isChannelOwned) channel.close()
else throw new GrpcClientCloseException()
override def closed: scala.concurrent.Future[pekko.Done] = channel.closed()
}
}
@PekkoGrpcGenerated
trait ServerReflectionClientPowerApi {
/**
* Lower level "lifted" version of the method, giving access to request metadata etc.
* prefer serverReflectionInfo(org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionRequest, org.apache.pekko.NotUsed]) if possible.
*/
def serverReflectionInfo(): StreamResponseRequestBuilder[org.apache.pekko.stream.scaladsl.Source[grpc.reflection.v1alpha.reflection.ServerReflectionRequest, org.apache.pekko.NotUsed], grpc.reflection.v1alpha.reflection.ServerReflectionResponse] = ???
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy