Documentation ¶
Index ¶
- Variables
- func RegisterRequestReceiverServer(s grpc.ServiceRegistrar, srv RequestReceiverServer)
- type ByeBye
- type RequestReceiver
- type RequestReceiverClient
- type RequestReceiverServer
- type RequestReceiver_ListenClient
- type RequestReceiver_ListenServer
- type UnimplementedRequestReceiverServer
- type UnsafeRequestReceiverServer
Constants ¶
This section is empty.
Variables ¶
var File_requestreceiver_requestreceiver_proto protoreflect.FileDescriptor
var RequestReceiver_ServiceDesc = grpc.ServiceDesc{ ServiceName: "requestreceiver.RequestReceiver", HandlerType: (*RequestReceiverServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Listen", Handler: _RequestReceiver_Listen_Handler, ClientStreams: true, }, }, Metadata: "requestreceiver/requestreceiver.proto", }
RequestReceiver_ServiceDesc is the grpc.ServiceDesc for RequestReceiver service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRequestReceiverServer ¶
func RegisterRequestReceiverServer(s grpc.ServiceRegistrar, srv RequestReceiverServer)
Types ¶
type ByeBye ¶
type ByeBye struct {
// contains filtered or unexported fields
}
func (*ByeBye) Descriptor
deprecated
func (*ByeBye) ProtoMessage ¶
func (*ByeBye) ProtoMessage()
func (*ByeBye) ProtoReflect ¶
func (x *ByeBye) ProtoReflect() protoreflect.Message
type RequestReceiver ¶
type RequestReceiver struct { UnimplementedRequestReceiverServer // contains filtered or unexported fields }
func NewRequestReceiver ¶
func NewRequestReceiver(node *mirbft.Node, logger logging.Logger) *RequestReceiver
NewRequestReceiver returns a new initialized request receiver. The returned RequestReceiver is not yet running (able to receive requests). This needs to be done explicitly by calling the Start() method. For the requests to be processed by passed Node, the Node must also be running.
func (*RequestReceiver) Listen ¶
func (rr *RequestReceiver) Listen(srv RequestReceiver_ListenServer) error
Listen implements the gRPC Listen service (multi-request-single-response). It receives messages from the gRPC client running on the MirBFT client and submits them to the Node associated with this RequestReceiver. This function is called by the gRPC system on every new connection from a MirBFT client's gRPC client.
func (*RequestReceiver) ServerError ¶
func (rr *RequestReceiver) ServerError() error
ServerError returns the error returned by the gRPC server's Serve() call. ServerError() must not be called before the RequestReceiver is stopped and its Stop() method has returned.
func (*RequestReceiver) Start ¶
func (rr *RequestReceiver) Start(port int) error
Start starts the RequestReceiver by initializing and starting the internal gRPC server, listening on the passed port. Before ths method is called, no client connections are accepted.
func (*RequestReceiver) Stop ¶
func (rr *RequestReceiver) Stop()
Stop stops the own gRPC server (preventing further incoming connections). After Stop() returns, the error returned by the gRPC server's Serve() call can be obtained through the ServerError() method.
type RequestReceiverClient ¶
type RequestReceiverClient interface {
Listen(ctx context.Context, opts ...grpc.CallOption) (RequestReceiver_ListenClient, error)
}
RequestReceiverClient is the client API for RequestReceiver service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRequestReceiverClient ¶
func NewRequestReceiverClient(cc grpc.ClientConnInterface) RequestReceiverClient
type RequestReceiverServer ¶
type RequestReceiverServer interface { Listen(RequestReceiver_ListenServer) error // contains filtered or unexported methods }
RequestReceiverServer is the server API for RequestReceiver service. All implementations must embed UnimplementedRequestReceiverServer for forward compatibility
type UnimplementedRequestReceiverServer ¶
type UnimplementedRequestReceiverServer struct { }
UnimplementedRequestReceiverServer must be embedded to have forward compatible implementations.
func (UnimplementedRequestReceiverServer) Listen ¶
func (UnimplementedRequestReceiverServer) Listen(RequestReceiver_ListenServer) error
type UnsafeRequestReceiverServer ¶
type UnsafeRequestReceiverServer interface {
// contains filtered or unexported methods
}
UnsafeRequestReceiverServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RequestReceiverServer will result in compilation errors.