object CantonGrpcUtil
- Alphabetic
- By Inheritance
- CantonGrpcUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit final class GrpcETFUSExtended[A] extends AnyVal
- implicit final class GrpcFUSExtended[A] extends AnyVal
- trait GrpcLogPolicy extends AnyRef
- implicit final class GrpcUSExtended[A] extends AnyVal
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bidirectionalStreamingRequest[Svc <: AbstractStub[Svc], F[_], HasObserver, Req, Resp](client: GrpcClient[Svc], observerFactory: (CancellableContext, HasRunOnClosing) => F[HasObserver])(getObserver: (HasObserver) => StreamObserver[Resp])(send: (Svc, StreamObserver[Resp]) => StreamObserver[Req])(implicit traceContext: TraceContext, F: Functor[F]): F[(HasObserver, StreamObserver[Req])]
Makes the bidirectional-streaming call via
send
on theclient
in a fresh cancellable gRPC io.grpc.Context that is used to construct the stream observer via theobserverFactory
.Makes the bidirectional-streaming call via
send
on theclient
in a fresh cancellable gRPC io.grpc.Context that is used to construct the stream observer via theobserverFactory
.- F
The effect type of the observer factory.
- observerFactory
Factory to create the stream observer for handling the message stream from the server.
- getObserver
Extracts the actual stream observer from the
HasObserver
instance.
- Annotations
- @GrpcServiceInvocationMethod()
- def checkCantonApiInfo(serverName: String, expectedName: String, channelBuilder: ManagedChannelBuilderProxy, logger: TracedLogger, timeout: NonNegativeDuration, hasRunOnClosing: HasRunOnClosing, token: Option[String])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, String, Unit]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapErrNew[T <: RpcError, C](value: EitherT[Future, T, C])(implicit ec: ExecutionContext): Future[C]
- def mapErrNew[T <: RpcError, C](value: Either[T, C])(implicit ec: ExecutionContext): EitherT[Future, StatusRuntimeException, C]
- def mapErrNewETUS[T <: RpcError, C](value: EitherT[FutureUnlessShutdown, T, C])(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): EitherT[Future, StatusRuntimeException, C]
- def mapErrNewEUS[T <: RpcError, C](value: EitherT[FutureUnlessShutdown, T, C])(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): Future[C]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def sendGrpcRequest[Svc <: AbstractStub[Svc], Res](client: GrpcClient[Svc], serverName: String)(send: (Svc) => Future[Res], requestDescription: String, timeout: Duration, logger: TracedLogger, logPolicy: GrpcLogPolicy = DefaultGrpcLogPolicy, retryPolicy: (GrpcError) => Boolean = _.retry)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, GrpcError, Res]
Wrapper method for sending a Grpc request.
Wrapper method for sending a Grpc request. Takes care of appropriate logging and retrying.
NOTE that this will NOT WORK for requests with streamed responses, as such requests will report errors to the corresponding io.grpc.stub.StreamObserver. You need to do error handling within the corresponding io.grpc.stub.StreamObserver.
- client
the Grpc client used to send the request
- serverName
used for logging
- send
the client method for sending the request
- requestDescription
used for logging
- timeout
determines how long to retry or wait for a response. Will retry until 70% of this timeout has elapsed. Will wait for a response until this timeout has elapsed.
- logPolicy
use this to configure log levels for errors
- retryPolicy
invoked after an error to determine whether to retry
- Annotations
- @GrpcServiceInvocationMethod()
- def sendGrpcRequestUnsafe[Svc <: AbstractStub[Svc], Resp](service: Svc)(send: (Svc) => Future[Resp])(implicit traceContext: TraceContext): Future[Resp]
Performs
send
once onservice
after having set the trace context in gRPC context.Performs
send
once onservice
after having set the trace context in gRPC context. Does not perform any error handling.Prefer sendGrpcRequest whenever possible
- Annotations
- @GrpcServiceInvocationMethod()
- def sendSingleGrpcRequest[Svc <: AbstractStub[Svc], Res](serverName: String, requestDescription: String, channelBuilder: ManagedChannelBuilderProxy, stubFactory: (Channel) => Svc, timeout: Duration, logger: TracedLogger, hasRunOnClosing: HasRunOnClosing, logPolicy: GrpcLogPolicy = DefaultGrpcLogPolicy, retryPolicy: (GrpcError) => Boolean, token: Option[String])(send: (Svc) => Future[Res])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, GrpcError, Res]
Method to create a grpc channel and send a single request
Method to create a grpc channel and send a single request
Based on sendGrpcRequest
- Annotations
- @GrpcServiceInvocationMethod()
- val sequencerHealthCheckServiceName: String
The name of the service that is associated with the sequencer servers' health status.
The name of the service that is associated with the sequencer servers' health status. This name can have no relation with the gRPC services that the server is running with, and can be anything as long as the client and servers use the same value.
- def serverStreamingRequest[Svc <: AbstractStub[Svc], HasObserver, Resp](client: GrpcClient[Svc], observerFactory: (CancellableContext, HasRunOnClosing) => HasObserver)(getObserver: (HasObserver) => StreamObserver[Resp])(send: (Svc, StreamObserver[Resp]) => Unit)(implicit traceContext: TraceContext): HasObserver
Makes the server-streaming call via
send
on theclient
in a fresh cancellable gRPC io.grpc.Context that is used to construct the stream observer via theobserverFactory
.Makes the server-streaming call via
send
on theclient
in a fresh cancellable gRPC io.grpc.Context that is used to construct the stream observer via theobserverFactory
.- observerFactory
Factory to create the stream observer for handling the message stream from the server.
- getObserver
Extracts the actual stream observer from the
HasObserver
instance.
- def shutdownAsGrpcError[C](value: FutureUnlessShutdown[C])(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): Future[C]
- def shutdownAsGrpcErrorE[A, B](value: EitherT[FutureUnlessShutdown, A, B])(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): EitherT[Future, A, B]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def wrapErrUS[T](value: EitherT[FutureUnlessShutdown, ProtoDeserializationError, T])(implicit loggingContext: ErrorLoggingContext, ec: ExecutionContext): EitherT[FutureUnlessShutdown, RpcError, T]
- def wrapErrUS[T](value: ParsingResult[T])(implicit loggingContext: ErrorLoggingContext, ec: ExecutionContext): EitherT[FutureUnlessShutdown, RpcError, T]
- object ApiName
- object DefaultGrpcLogPolicy extends GrpcLogPolicy
- object GrpcErrors extends GrpcErrorGroup
- object RetryPolicy
- object SilentLogPolicy extends GrpcLogPolicy