v.io: v.io/x/ref/lib/publisher Index | Files

package publisher

import "v.io/x/ref/lib/publisher"

Package publisher provides a type to publish names to a mounttable.


Package Files


type T Uses

type T struct {
    // contains filtered or unexported fields

T manages the publishing of names and servers in the mounttable. It spawns an internal goroutine the periodically performs mount and unmount rpcs. T is safe to use concurrently.

func New Uses

func New(ctx *context.T, ns namespace.T, period time.Duration) *T

New returns a new publisher that updates mounts on ns every period, and when changes are made to the state.

func (*T) AddName Uses

func (p *T) AddName(name string, mt bool, leaf bool)

AddName adds a new name for all servers to be mounted as.

func (*T) AddServer Uses

func (p *T) AddServer(server string)

AddServer adds a new server to be mounted under all names.

func (*T) Closed Uses

func (p *T) Closed() <-chan struct{}

Closed returns a channel that is closed when the publisher context is cancelled, and all unmount operations terminate.

func (*T) RemoveName Uses

func (p *T) RemoveName(name string)

RemoveName removes a name.

func (*T) RemoveServer Uses

func (p *T) RemoveServer(server string)

RemoveServer removes a server from the list of mounts.

func (*T) Status Uses

func (p *T) Status() ([]rpc.PublisherEntry, <-chan struct{})

Status returns a snapshot of the publisher's current state. The returned channel is closed when the state has become stale and the caller should repoll Status.

func (*T) String Uses

func (p *T) String() string

String returns a string representation of the publisher.

Package publisher imports 10 packages (graph) and is imported by 10 packages. Updated 2020-06-09. Refresh now. Tools for package owners.