pubsub

package
v0.0.0-...-6e90328 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseNotifier

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

BaseNotifier is a base implementation of the Notifier interface

func (*BaseNotifier) Attach

func (n *BaseNotifier) Attach(w Watcher)

func (*BaseNotifier) Detach

func (n *BaseNotifier) Detach(w Watcher)

func (*BaseNotifier) Notify

func (n *BaseNotifier) Notify(obj interface{})

type Notifier

type Notifier interface {
	Attach(w Watcher)
	Detach(w Watcher)
	Notify(obj interface{})
}

Notifier is an interface that send notification when data changes.

type Watcher

type Watcher interface {
	// Receipt is called by Notifier.Notify.
	Receipt(obj interface{})
}

Watcher is an interface that receive notification that the notifier notify when the data changes.

Jump to

Keyboard shortcuts

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