vecty: Index | Files

package storeutil

import ""

Package storeutil contains a ListenerRegistry type.


Package Files


type ListenerRegistry Uses

type ListenerRegistry struct {
    // contains filtered or unexported fields

ListenerRegistry is a listener registry. The zero value is unfit for use; use NewListenerRegistry to create an instance.

func NewListenerRegistry Uses

func NewListenerRegistry() *ListenerRegistry

NewListenerRegistry creates a listener registry.

func (*ListenerRegistry) Add Uses

func (r *ListenerRegistry) Add(key interface{}, listener func())

Add adds listener with key to the registry. key may be nil, then an arbitrary unused key is assigned. It panics if a listener with same key is already present.

func (*ListenerRegistry) Fire Uses

func (r *ListenerRegistry) Fire()

Fire invokes all listeners in the registry.

func (*ListenerRegistry) Remove Uses

func (r *ListenerRegistry) Remove(key interface{})

Remove removes a listener with key from the registry.

Package storeutil is imported by 1 packages. Updated 2017-11-15. Refresh now. Tools for package owners.