hubsub

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

type Hub[T any, Y SubConfig] struct {
	// contains filtered or unexported fields
}

func NewHub

func NewHub[T any, Y SubConfig](size int) *Hub[T, Y]

func (*Hub[T, Y]) Configs

func (h *Hub[T, Y]) Configs() []Y

func (*Hub[T, Y]) Publish

func (h *Hub[T, Y]) Publish(msg *T, key ...string)

func (*Hub[T, Y]) Sub

func (h *Hub[T, Y]) Sub(conf Y, handler func(*T, Y)) *Sub[T, Y]

func (*Hub[T, Y]) UnSub

func (h *Hub[T, Y]) UnSub(key string)

type Sub

type Sub[T any, Y SubConfig] struct {
	// contains filtered or unexported fields
}

func (*Sub[T, Y]) Publish

func (s *Sub[T, Y]) Publish(msg *T)

type SubConfig

type SubConfig interface {
	Key() string
}

Jump to

Keyboard shortcuts

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