bus

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package bus is the message bus. This package listens on various NATS channels for requests and publishes back responses to the same, or other channels. Responsible for talking to the liwords-socket server.

Index

Constants

View Source
const (
	MaxMessageLength = 500

	AdjudicateInterval   = 10 * time.Second
	GamesCounterInterval = 60 * time.Minute
	SeeksExpireInterval  = 10 * time.Minute
	// Cancel a game if it hasn't started after this much time.
	CancelAfter = 60 * time.Second
)
View Source
const (
	BotRequestID = "bot-request"
)
View Source
const (
	TournamentReadyExpire = 3600
)

Variables

View Source
var BootedReceiversMax = 5

Functions

This section is empty.

Types

type Bus

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

Bus is the struct; it should contain all the stores to verify messages, etc.

func NewBus

func NewBus(cfg *config.Config, stores Stores, redisPool *redis.Pool) (*Bus, error)

func (*Bus) ProcessMessages

func (b *Bus) ProcessMessages(ctx context.Context)

ProcessMessages is very similar to the PubsubProcess in liwords-socket, but that's because they do similar things.

func (*Bus) TournamentEventChannel added in v0.1.3

func (b *Bus) TournamentEventChannel() chan *entity.EventWrapper

type Stores added in v0.1.3

type Stores struct {
	UserStore       user.Store
	GameStore       gameplay.GameStore
	SoughtGameStore gameplay.SoughtGameStore
	PresenceStore   user.PresenceStore
	ChatStore       user.ChatStore
	ListStatStore   stats.ListStatStore
	NotorietyStore  mod.NotorietyStore
	TournamentStore tournament.TournamentStore
	ConfigStore     config.ConfigStore
	SessionStore    sessions.SessionStore
}

Jump to

Keyboard shortcuts

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