msque

package
v0.0.0-...-1b41ab9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLen    = 1<<32 - 1
	MaxRetry  = 1<<8 - 1
	HeaderLen = 4 + 8 + 1
)
Memory model in message

| len | ts | retry | payload | | -------------- | ----------------- | ------------- | ------------ | | payload length | enqueue timestamp | enqueue times | message body | | uint32 | int64 | uint8 | []byte | | 4294967295 | - | 255 | 4095MB |

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageHandler

type MessageHandler interface {
	HandleMessage(bts []byte) (err error)
}

type MessageHandlerFunc

type MessageHandlerFunc func(bts []byte) (err error)

func (MessageHandlerFunc) HandleMessage

func (h MessageHandlerFunc) HandleMessage(bts []byte) (err error)

type MessageQueue

type MessageQueue interface {
	Publish(topic string, bts []byte) (err error)
	Subscribe(topic string, handler MessageHandler)
}

Jump to

Keyboard shortcuts

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