broker

package
v0.0.0-...-388d6c9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package broker implements a broker server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	pb.UnimplementedSchedulerServiceServer
	// contains filtered or unexported fields
}

Handler implements the broker grpc server.

func NewHandler

func NewHandler(s Scheduler) *Handler

NewHandler create a broker grpc server.

func (*Handler) SendDelayMessage

func (s *Handler) SendDelayMessage(ctx context.Context, req *pb.SendDelayMessageRequest) (*emptypb.Empty, error)

SendDelayMessage send a delay message to the broker.

type Scheduler

type Scheduler interface {
	// Run start the scheduler
	Run()
	// Produce produce a Message to DelayStorage
	Produce(ctx context.Context, msg *types.Message) error
	// NewConsumer consume Messages from the RealTime Connector queue
	NewConsumer(topic, group string, batchSize int, fn type2.HandleMessage) error
	// Close close the scheduler
	Close() error
}

Scheduler interface

func New

New create a new scheduler

Directories

Path Synopsis
Package connector provides the connector of the broker.
Package connector provides the connector of the broker.
kafka_connector
Package kafka_connector provides a connector to Kafka
Package kafka_connector provides a connector to Kafka
redis_connector
Package redis_connector implements a connector with redis
Package redis_connector implements a connector with redis
pkg
types
Package types provides the types of the broker.
Package types provides the types of the broker.
Package server provides the start and dependency registration of the broker server
Package server provides the start and dependency registration of the broker server
Package storage provides the storage of the broker.
Package storage provides the storage of the broker.
redis_storage
Package redis_storage implements a storage with redis.
Package redis_storage implements a storage with redis.

Jump to

Keyboard shortcuts

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