remote

package
v0.0.0-...-839ea1c Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package remote implements a multiplexer of clients. From the perspective of the room, it will be like interracting with many, but in truth they will all be consumed from here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Multiplexer

type Multiplexer struct {

	// Used to pass around notifications from Remote
	Notifier
	// contains filtered or unexported fields
}

Multiplexer acts as an intermediate between rooms and remote clients

func New

func New(
	n Notifier,
	events <-chan event.Query,
) Multiplexer

New initializes a Multiplexer

func (*Multiplexer) Run

func (mx *Multiplexer) Run(ctx context.Context, remote Remote)

Run the multiplexer work loop

type Notifier

type Notifier interface {
	Forward(e string, t user.Token) (<-chan event.Reply, error)
}

Notifier allows to forward notifications on the chain

type Payload

type Payload interface {
	Type() string
	User() user.Token
}

Payload coming from remote

type Remote

type Remote interface {
	Publish(ctx context.Context, e event.Envelope)
	SubRooms(context.Context) <-chan Payload
	SubMessages(ctx context.Context) <-chan envelope.Message
}

Remote allows to subscribe to events

Jump to

Keyboard shortcuts

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