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 ChannelMonitorInterval = 5 * time.Second // 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 GameEventStreamPrefix = "/api/game/eventstream/"
View Source
const (
TournamentReadyExpire = 3600
)
View Source
const UserEventStreamPrefix = "/api/eventstream/"
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 (*Bus) EventAPIServerInstance ¶
func (b *Bus) EventAPIServerInstance() *EventAPIServer
func (*Bus) GameEventChannel ¶
func (b *Bus) GameEventChannel() chan *entity.EventWrapper
func (*Bus) ProcessMessages ¶
ProcessMessages is very similar to the PubsubProcess in liwords-socket, but that's because they do similar things.
func (*Bus) TournamentEventChannel ¶
func (b *Bus) TournamentEventChannel() chan *entity.EventWrapper
type EventAPIServer ¶
func NewEventApiServer ¶
func NewEventApiServer(ustore user.Store, gstore gameplay.GameStore) *EventAPIServer
func (*EventAPIServer) ServeHTTP ¶
func (s *EventAPIServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.