bus

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmbeddedNats

func NewEmbeddedNats()

Types

type Bus

type Bus interface {
	Lock(ctx context.Context, key string, ka time.Duration) (Lock, error)

	Send(k string, v []byte) error
	Recv(topic string) chan []byte
}

func NewSolo

func NewSolo() (Bus, error)

type Lock

type Lock interface {
	context.Context
	Unlock()
	KeepAlive() error
}

type SoloBus

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

func (*SoloBus) Lock

func (s *SoloBus) Lock(ctx context.Context, key string, ka time.Duration) (Lock, error)

func (*SoloBus) Recv

func (self *SoloBus) Recv(topic string) chan []byte

func (*SoloBus) Send

func (self *SoloBus) Send(topic string, v []byte) error

type SoloLock

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

func (*SoloLock) Deadline

func (self *SoloLock) Deadline() (deadline time.Time, ok bool)

func (*SoloLock) Done

func (self *SoloLock) Done() <-chan struct{}

func (*SoloLock) Err

func (self *SoloLock) Err() error

func (*SoloLock) KeepAlive

func (self *SoloLock) KeepAlive() error

func (*SoloLock) Unlock

func (self *SoloLock) Unlock()

func (*SoloLock) Value

func (self *SoloLock) Value(key any) any

Jump to

Keyboard shortcuts

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