github.com/songzhibin97/gkit@v1.2.13/distributed/option.go (about)

     1  package distributed
     2  
     3  import "github.com/songzhibin97/gkit/options"
     4  
     5  // SetNoUnixSignals 设置是否优雅关闭
     6  func SetNoUnixSignals(noUnixSignals bool) options.Option {
     7  	return func(o interface{}) {
     8  		o.(*Config).NoUnixSignals = noUnixSignals
     9  	}
    10  }
    11  
    12  // SetResultExpire 设置 backend result 过期时间
    13  func SetResultExpire(expire int64) options.Option {
    14  	return func(o interface{}) {
    15  		o.(*Config).ResultExpire = expire
    16  	}
    17  }
    18  
    19  // SetConcurrency 设置并发量
    20  func SetConcurrency(concurrency int64) options.Option {
    21  	return func(o interface{}) {
    22  		o.(*Config).Concurrency = concurrency
    23  	}
    24  }
    25  
    26  // SetConsumeQueue 设置消费队列
    27  func SetConsumeQueue(consumeQueue string) options.Option {
    28  	return func(o interface{}) {
    29  		o.(*Config).ConsumeQueue = consumeQueue
    30  	}
    31  }
    32  
    33  // SetDelayedQueue 设置延时队列
    34  func SetDelayedQueue(delayedQueue string) options.Option {
    35  	return func(o interface{}) {
    36  		o.(*Config).DelayedQueue = delayedQueue
    37  	}
    38  }