subscriber

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRelay = "tcp://eddn.edcd.io:9500"
	GoodTimeout  = 6 * time.Second
)

Variables

This section is empty.

Functions

func Blocking

func Blocking(c chan<- []byte, data []byte, _ eddnc.ScmID)

func Dropping

func Dropping(c chan<- []byte, data []byte, queue string)

func SetLog added in v0.3.2

func SetLog(l *slog.Logger)

Types

type Config

type Config struct {
	Relay       string
	ConnTimeout time.Duration
	RecvTimeout time.Duration
	QCaps       [eddnc.ScmNo]int
	Enqueue     EnqueueFunc
}

func (*Config) AllQCaps

func (cfg *Config) AllQCaps(cap int) *Config

NoQ disables all channels, i.e. set the QCaps to -1.

func (*Config) QCap

func (cfg *Config) QCap(q eddnc.ScmID, cap int) *Config

QCap sets the capactiy of the channel for schema ID q to cap.

type DropStats

type DropStats struct{ Total, Dropped uint64 }

type DropWithStats

type DropWithStats map[eddnc.ScmID]*DropStats

func NewDropWithStats

func NewDropWithStats() DropWithStats

func (DropWithStats) Enqueue

func (dws DropWithStats) Enqueue(c chan<- []byte, data []byte, queue eddnc.ScmID)

type EnqueueFunc

type EnqueueFunc func(c chan<- []byte, data []byte, scm eddnc.ScmID)

type S

type S struct {
	Chan [eddnc.ScmNo]<-chan []byte
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) *S

func (*S) Close

func (s *S) Close() bool

func (*S) Return

func (s *S) Return(rawEvent []byte)

func (*S) TRecvUnixMilli

func (s *S) TRecvUnixMilli() int64

func (*S) UsedChannels

func (s *S) UsedChannels() int

Jump to

Keyboard shortcuts

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