Add task pool, minor changes

- Add task pool to smooth impact when list in config is pretty long
- Update dependencies
- Update config
This commit is contained in:
eleksir
2024-04-06 12:39:41 +03:00
parent 4d04731aeb
commit dc89d197d9
21 changed files with 1558 additions and 157 deletions

View File

@@ -16,6 +16,13 @@ type Config struct {
// Whether to print debug info on stdout.
Debug bool `yaml:"debug,omitempty"`
// Maximum workers in pool.
MaxWorkers int `yaml:"max_workers,omitempty"`
// Capacity of non-blocking tasks. All tasks that exceeding this capacity will block submission of new tasks until
// queue has vacant place for new task.
NbCapacity int `yaml:"nb_capacity,omitempty"`
// В гошке yaml не позволяет сделать удобный парсер для конструкций, аналогичных json-овскому
// {kill:{"stop":["proc1","proc2"], "term":["proc3","proc4"]}}
// Поэтому мы просто возьмём массив и каждому элементу добавим тип сигнала.