requestreceiver

package
v0.0.0-...-bd4e2c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_requestreceiver_requestreceiver_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use ByeBye.ProtoReflect.Descriptor instead.

func (*ByeBye) ProtoMessage

func (*ByeBye) ProtoMessage()

func (*ByeBye) ProtoReflect

func (x *ByeBye) ProtoReflect() protoreflect.Message

func (*ByeBye) Reset

func (x *ByeBye) Reset()

func (*ByeBye) String

func (x *ByeBye) String() string

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

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.

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 RequestReceiver_ListenClient

type RequestReceiver_ListenClient interface {
	Send(*requestpb.Request) error
	CloseAndRecv() (*ByeBye, error)
	grpc.ClientStream
}

type RequestReceiver_ListenServer

type RequestReceiver_ListenServer interface {
	SendAndClose(*ByeBye) error
	Recv() (*requestpb.Request, error)
	grpc.ServerStream
}

type UnimplementedRequestReceiverServer

type UnimplementedRequestReceiverServer struct {
}

UnimplementedRequestReceiverServer must be embedded to have forward compatible implementations.

func (UnimplementedRequestReceiverServer) Listen

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL