pubsub

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package pubsub receives internal events.

Package pubsub receives internal events.

Package pubsub receives internal events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptNewPeerCommandHandler

type AcceptNewPeerCommandHandler interface {
	Handle(ctx context.Context, peer transport.Peer)
}

type NewPeerSubscriber

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

func NewNewPeerSubscriber

func NewNewPeerSubscriber(
	pubsub *pubsub.NewPeerPubSub,
	handler AcceptNewPeerCommandHandler,
	logger logging.Logger,
) *NewPeerSubscriber

func (*NewPeerSubscriber) Run

func (p *NewPeerSubscriber) Run(ctx context.Context) error

type ProcessRoomAttendantEventHandler

type ProcessRoomAttendantEventHandler interface {
	Handle(ctx context.Context, cmd commands.ProcessRoomAttendantEvent) error
}

type RequestSubscriber

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

RequestSubscriber receives internal events containing arriving RPC requests and passes them to the RPC mux.

This is done because while it makes perfect sense for the RPC mux to be a port our program creates new RPC connections (which are sources of RPC requests) not only in the ports layer but also in the application layer (when establishing new connections). This is different from common programs which only receive incoming connections which e.g. provide REST requests. Since both the fact that connections must exist in the application layer and the fact that the RPC mux is a port make sense then we need a mechanism such as pub sub to bridge the two parts of the program together as the application layer can't directly drive ports.

func NewRequestSubscriber

func NewRequestSubscriber(pubsub *pubsub.RequestPubSub, mux *mux.Mux) *RequestSubscriber

func (*RequestSubscriber) Run

func (p *RequestSubscriber) Run(ctx context.Context) error

Run keeps receiving RPC request from the pubsub and passing them to the RPC mux until the context is closed.

type RoomAttendantEventSubscriber

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

func (*RoomAttendantEventSubscriber) Run

Jump to

Keyboard shortcuts

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