memory

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockerMap

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

LockerMap is locker map based on memory.

func NewLockerMap

func NewLockerMap() *LockerMap

NewLockerMap creates an instance of LockerMap.

func (*LockerMap) Close

func (m *LockerMap) Close() error

Close closes all resources of this LockerMap.

func (*LockerMap) NewLocker

func (m *LockerMap) NewLocker(
	ctx context.Context,
	key sync.Key,
) (sync.Locker, error)

NewLocker creates locker of the given key.

type PubSub

type PubSub struct {
	AgentInfo *sync.AgentInfo
	// contains filtered or unexported fields
}

PubSub is the memory implementation of PubSub, used for single agent or tests.

func NewPubSub

func NewPubSub(info *sync.AgentInfo) *PubSub

NewPubSub creates an instance of PubSub.

func (*PubSub) Members added in v0.1.5

func (m *PubSub) Members() map[string]*sync.AgentInfo

Members returns the members of this cluster.

func (*PubSub) Publish

func (m *PubSub) Publish(
	publisherID *time.ActorID,
	topic string,
	event sync.DocEvent,
)

Publish publishes the given event to the given Topic.

func (*PubSub) Subscribe

func (m *PubSub) Subscribe(
	subscriber types.Client,
	topics []string,
) (*sync.Subscription, map[string][]types.Client, error)

Subscribe subscribes to the given topics.

func (*PubSub) Unsubscribe

func (m *PubSub) Unsubscribe(topics []string, sub *sync.Subscription)

Unsubscribe unsubscribes the given topics.

Jump to

Keyboard shortcuts

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