Documentation ¶
Index ¶
- type Coordinator
- func (m *Coordinator) Close() error
- func (m *Coordinator) Members() map[string]*sync.AgentInfo
- func (m *Coordinator) NewLocker(ctx context.Context, key sync.Key) (sync.Locker, error)
- func (m *Coordinator) Publish(_ context.Context, publisherID *time.ActorID, event sync.DocEvent)
- func (m *Coordinator) PublishToLocal(_ context.Context, publisherID *time.ActorID, event sync.DocEvent)
- func (m *Coordinator) Subscribe(_ context.Context, subscriber types.Client, keys []*key.Key) (*sync.Subscription, map[string][]types.Client, error)
- func (m *Coordinator) Unsubscribe(_ context.Context, keys []*key.Key, sub *sync.Subscription) error
- func (m *Coordinator) UpdateMetadata(_ context.Context, publisher *types.Client, keys []*key.Key) (*sync.DocEvent, error)
- type PubSub
- func (m *PubSub) BuildPeersMap(keys []*key.Key) map[string][]types.Client
- func (m *PubSub) Publish(publisherID *time.ActorID, event sync.DocEvent)
- func (m *PubSub) Subscribe(subscriber types.Client, keys []*key.Key) (*sync.Subscription, error)
- func (m *PubSub) Unsubscribe(docKeys []*key.Key, sub *sync.Subscription)
- func (m *PubSub) UpdateMetadata(publisher *types.Client, keys []*key.Key) *sync.Subscription
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) 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.
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub is the memory implementation of PubSub, used for single agent.
func (*PubSub) BuildPeersMap ¶ added in v0.1.7
BuildPeersMap builds the peers map of the given 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
UpdateMetadata updates the metadata of the given client.
Click to show internal directories.
Click to hide internal directories.