rediswatcher

package
v0.0.0-...-dfaa8e5 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWatcher

func NewWatcher(client *redis.Client, setters ...WatcherOption) persist.Watcher

NewWatcher return new watcher service.

Types

type Watcher

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

Watcher is the watcher service.

func (*Watcher) Close

func (w *Watcher) Close() error

Close exits the watcher.

func (*Watcher) SetUpdateCallback

func (w *Watcher) SetUpdateCallback(channel string, callback func(string))

SetUpdateCallBack sets the update callback function invoked by the watcher when the data is updated.

func (*Watcher) Update

func (w *Watcher) Update(channel string, identity string) error

Update publishes a message to all other instances telling them to invoke their update callback

type WatcherOption

type WatcherOption func(*WatcherOptions)

func RaiseOwn

func RaiseOwn(filterOwn bool) WatcherOption

type WatcherOptions

type WatcherOptions struct {
	RaiseOwn bool
}

Jump to

Keyboard shortcuts

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