memory

package
v0.1.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator added in v0.1.6

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

Coordinator is a memory-based implementation of sync.Coordinator.

func NewCoordinator added in v0.1.6

func NewCoordinator(agentInfo *sync.AgentInfo) *Coordinator

NewCoordinator creates an instance of Coordinator.

func (*Coordinator) Close added in v0.1.6

func (m *Coordinator) Close() error

Close closes all resources of this Coordinator.

func (*Coordinator) Members added in v0.1.6

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

Members returns the members of this cluster.

func (*Coordinator) NewLocker added in v0.1.6

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

NewLocker creates locker of the given key.

func (*Coordinator) Publish added in v0.1.6

func (m *Coordinator) Publish(
	_ context.Context,
	publisherID *time.ActorID,
	event sync.DocEvent,
)

Publish publishes the given event.

func (*Coordinator) PublishToLocal added in v0.1.6

func (m *Coordinator) PublishToLocal(
	_ context.Context,
	publisherID *time.ActorID,
	event sync.DocEvent,
)

PublishToLocal publishes the given event.

func (*Coordinator) Subscribe added in v0.1.6

func (m *Coordinator) Subscribe(
	_ context.Context,
	subscriber types.Client,
	keys []*key.Key,
) (*sync.Subscription, map[string][]types.Client, error)

Subscribe subscribes to the given documents.

func (*Coordinator) Unsubscribe added in v0.1.6

func (m *Coordinator) Unsubscribe(
	_ context.Context,
	keys []*key.Key,
	sub *sync.Subscription,
) error

Unsubscribe unsubscribes the given documents.

func (*Coordinator) UpdateMetadata added in v0.1.7

func (m *Coordinator) UpdateMetadata(
	_ context.Context,
	publisher *types.Client,
	keys []*key.Key,
) (*sync.DocEvent, error)

UpdateMetadata updates the metadata of the given client.

type PubSub

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

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

func NewPubSub

func NewPubSub() *PubSub

NewPubSub creates an instance of PubSub.

func (*PubSub) BuildPeersMap added in v0.1.7

func (m *PubSub) BuildPeersMap(keys []*key.Key) map[string][]types.Client

BuildPeersMap builds the peers map of the given keys.

func (*PubSub) Publish

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

Publish publishes the given event.

func (*PubSub) Subscribe

func (m *PubSub) Subscribe(
	subscriber types.Client,
	keys []*key.Key,
) (*sync.Subscription, error)

Subscribe subscribes to the given document keys.

func (*PubSub) Unsubscribe

func (m *PubSub) Unsubscribe(
	docKeys []*key.Key,
	sub *sync.Subscription,
)

Unsubscribe unsubscribes the given docKeys.

func (*PubSub) UpdateMetadata added in v0.1.7

func (m *PubSub) UpdateMetadata(
	publisher *types.Client,
	keys []*key.Key,
) *sync.Subscription

UpdateMetadata updates the metadata of the given client.

Jump to

Keyboard shortcuts

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