github.com/anycable/anycable-go@v1.5.1/broker/config.go (about)

     1  package broker
     2  
     3  type Config struct {
     4  	// For how long to keep history in seconds
     5  	HistoryTTL int64
     6  	// Max size of messages to keep in the history per stream
     7  	HistoryLimit int
     8  	// Sessions cache TTL in seconds (after disconnect)
     9  	SessionsTTL int64
    10  }
    11  
    12  func NewConfig() Config {
    13  	return Config{
    14  		// 5 minutes by default
    15  		HistoryTTL: 5 * 60,
    16  		// 100 msgs by default
    17  		HistoryLimit: 100,
    18  		// 5 minutes by default
    19  		SessionsTTL: 5 * 60,
    20  	}
    21  }