subs

package
v0.0.0-...-af941b8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package subs is responsible for communication between modules and it facilitates dependency decoupling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subject

type Subject[T any] struct {
	// contains filtered or unexported fields
}

Subject is a single topic, which supports multiple subscribers.

func (*Subject[T]) Publish

func (s *Subject[T]) Publish(message T)

Publish message to all registered subscribers.

func (*Subject[T]) Subscribe

func (s *Subject[T]) Subscribe(handler events.Handler[T])

Subscribe registers a handler for event processing.

Jump to

Keyboard shortcuts

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