object CantonGrpcUtil
- Alphabetic
- By Inheritance
- CantonGrpcUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit final class GrpcFUSExtended[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 checkCantonApiInfo(serverName: String, expectedName: String, channel: ManagedChannel, logger: TracedLogger, timeout: NonNegativeDuration)(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[Future, String, Unit]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- 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
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def invalidArgument(err: String): StatusRuntimeException
- Annotations
- @Deprecated
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def mapErr[T, C](value: EitherT[Future, T, C])(implicit ec: ExecutionContext): EitherT[Future, StatusRuntimeException, C]
- Annotations
- @Deprecated
- def mapErr[T, C](value: Either[T, C])(implicit ec: ExecutionContext): EitherT[Future, StatusRuntimeException, C]
- Annotations
- @Deprecated
- def mapErrF[T, C](value: EitherT[Future, T, C])(implicit ec: ExecutionContext): Future[C]
- Annotations
- @Deprecated
- def mapErrNew[T <: CantonError, C](value: EitherT[Future, T, C])(implicit ec: ExecutionContext): Future[C]
- def mapErrNew[T <: BaseCantonError, C](value: EitherT[Future, T, C])(implicit executionContext: ExecutionContext, errorLoggingContext: ErrorLoggingContext): Future[C]
- def mapErrNew[T <: CantonError, C](value: Either[T, C])(implicit ec: ExecutionContext): EitherT[Future, StatusRuntimeException, C]
- def mapErrNewET[T <: CantonError, C](value: EitherT[Future, T, C])(implicit ec: ExecutionContext): EitherT[Future, StatusRuntimeException, C]
- def mapErrNewETUS[T <: CantonError, C](value: EitherT[FutureUnlessShutdown, T, C])(implicit ec: ExecutionContext, errorLoggingContext: ErrorLoggingContext): EitherT[Future, StatusRuntimeException, C]
- def mapErrNewEUS[T <: CantonError, 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
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def retryUnlessClosing(closing: () => Boolean)(error: GrpcError): Boolean
- def sendGrpcRequest[Svc <: AbstractStub[Svc], Res](client: Svc, serverName: String)(send: (Svc) => Future[Res], requestDescription: String, timeout: Duration, logger: TracedLogger, logPolicy: (GrpcError) => (TracedLogger) => (TraceContext) => Unit = err =>
logger => traceContext => err.log(logger)(traceContext), retryPolicy: (GrpcError) => Boolean = _.retry)(implicit traceContext: TraceContext): EitherT[Future, 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
- def sendSingleGrpcRequest[Svc <: AbstractStub[Svc], Res](serverName: String, requestDescription: String, channel: ManagedChannel, stubFactory: (Channel) => Svc, timeout: Duration, logger: TracedLogger, logPolicy: (GrpcError) => (TracedLogger) => (TraceContext) => Unit = err =>
logger => traceContext => err.log(logger)(traceContext), retryPolicy: (GrpcError) => Boolean = _.retry)(send: (Svc) => Future[Res])(implicit traceContext: TraceContext): EitherT[Future, 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
- 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 silentLogPolicy(error: GrpcError)(logger: TracedLogger)(traceContext: TraceContext): Unit
- 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 wrapErr[T](value: EitherT[Future, ProtoDeserializationError, T])(implicit loggingContext: ErrorLoggingContext, ec: ExecutionContext): EitherT[Future, CantonError, T]
- def wrapErr[T](value: ParsingResult[T])(implicit loggingContext: ErrorLoggingContext, ec: ExecutionContext): EitherT[Future, CantonError, T]
- object ApiName
- object GrpcErrors extends GrpcErrorGroup
- object RetryPolicy