Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureExists ¶
Types ¶
type AsynqWorkerConfig ¶ added in v0.10.0
type AsynqWorkerConfig struct { RedisConfig RedisConfig WorkerConfig WorkerConfig }
type Conf ¶
type Conf struct { config.Common Client config.Client Chainstore config.Chainstore Storage StorageConf Queue QueueConfig }
Conf defines the daemon config. It should be compatible with Lotus config.
func DefaultConf ¶
func DefaultConf() *Conf
func FromFile ¶
FromFile loads config from a specified file. If file does not exist or is empty defaults are assumed.
func FromReader ¶
FromReader loads config from a reader instance.
func SampleConf ¶
func SampleConf() *Conf
SampleConf is the example configuration that is written when lily is first started. All entries will be commented out.
type FileStorageConf ¶
type PgStorageConf ¶
type QueueConfig ¶ added in v0.10.0
type QueueConfig struct { Workers map[string]AsynqWorkerConfig Notifiers map[string]RedisConfig }
type RedisConfig ¶ added in v0.10.0
type RedisConfig struct { // Network type to use, either tcp or unix. // Default is tcp. Network string // Redis server address in "host:port" format. Addr string // Username to authenticate the current connection when Redis ACLs are used. // See: https://redis.io/commands/auth. Username string // Password to authenticate the current connection. // See: https://redis.io/commands/auth. Password string PasswordEnv string // Redis DB to select after connecting to a server. // See: https://redis.io/commands/select. DB int // Maximum number of socket connections. // Default is 10 connections per every CPU as reported by runtime.NumCPU. PoolSize int }
type StorageConf ¶
type StorageConf struct { Postgresql map[string]PgStorageConf File map[string]FileStorageConf }
type WorkerConfig ¶ added in v0.10.0
type WorkerConfig struct { // Maximum number of concurrent processing of tasks. // // If set to a zero or negative value, NewServer will overwrite the value // to the number of CPUs usable by the current process. Concurrency int // LogLevel specifies the minimum log level to enable. // // If unset, InfoLevel is used by default. LoggerLevel string // Priority is treated as follows to avoid starving low priority queues. // // Example: // // WatchQueuePriority: 5 // FillQueuePriority: 3 // IndexQueuePriority: 1 // WalkQueuePriority: 1 // // With the above config and given that all queues are not empty, the tasks // in "watch", "fill", "index", "walk" should be processed 50%, 30%, 10%, 10% of // the time respectively. WatchQueuePriority int FillQueuePriority int IndexQueuePriority int WalkQueuePriority int // StrictPriority indicates whether the queue priority should be treated strictly. // // If set to true, tasks in the queue with the highest priority is processed first. // The tasks in lower priority queues are processed only when those queues with // higher priorities are empty. StrictPriority bool // ShutdownTimeout specifies the duration to wait to let workers finish their tasks // before forcing them to abort when stopping the server. // // If unset or zero, default timeout of 8 seconds is used. ShutdownTimeout time.Duration }
func (WorkerConfig) LogLevel ¶ added in v0.10.0
func (q WorkerConfig) LogLevel() asynq.LogLevel
func (WorkerConfig) Queues ¶ added in v0.10.0
func (q WorkerConfig) Queues() map[string]int
Click to show internal directories.
Click to hide internal directories.