relay

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

Publisher provides methods to send updates to all subscribers of a certain topic.

func (*Publisher) Close

func (p *Publisher) Close()

Close tells the broker there will be no more updates coming from p. Calling Publish() after Close() returns immediately. Calling Close() makes the broker unsubscribe all subscribers and telling them updates on the topic have ended.

func (*Publisher) Publish

func (p *Publisher) Publish(messages ...protocol.Message)

Publish notifies p's broker that there is an update on p's topic and blocks until the broker received the notification. Publish then blocks until the broker received the update. Calling Publish() after Close() returns immediately. Use p's Stop channel to know when the broker stopped listening.

type Relay

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

Relay relays positional data between clients

func New

func New() *Relay

func (*Relay) AddClient

func (r *Relay) AddClient(cn uint32, sf sendFunc) (positions *Publisher, packets *Publisher)

func (*Relay) FlushPositionAndSend

func (r *Relay) FlushPositionAndSend(cn uint32, p protocol.Message)

func (*Relay) RemoveClient

func (r *Relay) RemoveClient(cn uint32) error

Jump to

Keyboard shortcuts

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