roque

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 6 Imported by: 0

README

roque

Simple message queue

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	WriteContext(ctx context.Context, topic message.Topic, msgs ...[]byte) error
	ReadContext(ctx context.Context, clientID string, topic message.Topic, limit int, wait time.Duration) ([]message.Message, error)
	CommitContext(ctx context.Context, clientID string, topic message.Topic, idx int) error
}

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(store Store) *Dispatcher

func (*Dispatcher) CommitContext

func (d *Dispatcher) CommitContext(ctx context.Context, clientID string, topic message.Topic, idx int) error

func (*Dispatcher) ReadContext

func (d *Dispatcher) ReadContext(ctx context.Context, clientID string, topic message.Topic, limit int, wait time.Duration) ([]message.Message, error)

func (*Dispatcher) WriteContext

func (d *Dispatcher) WriteContext(ctx context.Context, topic string, msgs ...[]byte) error

type Signal

type Signal struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSignal

func NewSignal() *Signal

func (*Signal) Emit

func (s *Signal) Emit(topic string)

func (*Signal) WaitContext

func (s *Signal) WaitContext(ctx context.Context, topic string, timeout time.Duration) bool

type Store

type Store interface {
	Append(topic string, msgs ...[]byte) error
	Commit(clientID string, topic string, idx int) error
	FetchNext(clientID string, topic string, limit int) ([]message.Message, error)
}

func NewSqliteStore

func NewSqliteStore(dsn string) (Store, error)

Directories

Path Synopsis
cmd
read_test command
roqued command
roundtrip command
write_test command

Jump to

Keyboard shortcuts

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