grpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address           string
	MaxConnectionIdle time.Duration
	MaxConnectionAge  time.Duration
	KeepAliveInterval time.Duration
	KeepAliveTimeout  time.Duration
}

Config holds gRPC server configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default gRPC configuration

type Server

type Server struct {
	pb.UnimplementedAMQServer
	// contains filtered or unexported fields
}

Server implements the gRPC AMQ service

func NewServer

func NewServer(manager *queue.Manager, config Config) *Server

NewServer creates a new gRPC server

func (*Server) AckMessage

func (s *Server) AckMessage(ctx context.Context, req *pb.AckMessageRequest) (*emptypb.Empty, error)

AckMessage acknowledges a message

func (*Server) CreateQueue

func (s *Server) CreateQueue(ctx context.Context, req *pb.CreateQueueRequest) (*pb.CreateQueueResponse, error)

CreateQueue creates a new queue

func (*Server) GetQueueStats

func (s *Server) GetQueueStats(ctx context.Context, req *pb.GetQueueStatsRequest) (*pb.GetQueueStatsResponse, error)

GetQueueStats returns queue statistics

func (*Server) Heartbeat

func (s *Server) Heartbeat(ctx context.Context, req *pb.HeartbeatRequest) (*emptypb.Empty, error)

Heartbeat updates client heartbeat

func (*Server) ReceiveMessages

func (s *Server) ReceiveMessages(req *pb.ReceiveMessagesRequest, stream pb.AMQ_ReceiveMessagesServer) error

ReceiveMessages streams messages to the client

func (*Server) RegisterClient

func (s *Server) RegisterClient(ctx context.Context, req *pb.RegisterClientRequest) (*pb.RegisterClientResponse, error)

RegisterClient registers a new client

func (*Server) Start

func (s *Server) Start() error

Start starts the gRPC server

func (*Server) Stop

func (s *Server) Stop()

Stop stops the gRPC server

func (*Server) SubmitTask

func (s *Server) SubmitTask(ctx context.Context, req *pb.SubmitTaskRequest) (*pb.SubmitTaskResponse, error)

SubmitTask submits a task message

func (*Server) SubmitTaskBatch

func (s *Server) SubmitTaskBatch(ctx context.Context, req *pb.SubmitTaskBatchRequest) (*pb.SubmitTaskBatchResponse, error)

SubmitTaskBatch submits multiple tasks in batch

func (*Server) UnregisterClient

func (s *Server) UnregisterClient(ctx context.Context, req *pb.UnregisterClientRequest) (*emptypb.Empty, error)

UnregisterClient unregisters a client

Jump to

Keyboard shortcuts

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