survey

package
v0.0.0-...-996fa4a Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Surveyee

type Surveyee interface {
	OnSurvey(queryType string, request []byte) (response []byte, ok bool)
}

Surveyee handles the surveys.

type Surveyor

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

Surveyor represents a distributed surveyor.

func New

func New(p service.PubSub, g gossiper) *Surveyor

New creates a new distributed surveyor.

func (*Surveyor) HandleFunc

func (c *Surveyor) HandleFunc(surveyees ...Surveyee)

HandleFunc adds a handler for a query.

func (*Surveyor) ID

func (c *Surveyor) ID() string

ID returns the unique identifier of the subsriber.

func (*Surveyor) Query

func (c *Surveyor) Query(query string, payload []byte) (message.Awaiter, error)

Query issues a cluster-wide request.

func (*Surveyor) Send

func (c *Surveyor) Send(m *message.Message) error

Send occurs when we have received a message.

func (*Surveyor) Start

func (c *Surveyor) Start()

Start subscribes the manager to the query channel.

func (*Surveyor) Type

func (c *Surveyor) Type() message.SubscriberType

Type returns the type of the subscriber

Jump to

Keyboard shortcuts

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