Documentation
¶
Index ¶
- type ExecutionFn
- type FnParam
- type Job
- type JobID
- type WorkerPool
- func (wp *WorkerPool) Add(ctx context.Context, settings *models.Settings, execFn ExecutionFn) JobID
- func (wp *WorkerPool) Close() error
- func (wp *WorkerPool) Delete(ctx context.Context, jobID JobID)
- func (wp *WorkerPool) GenerateFrom(jobsBulk []Job)
- func (wp *WorkerPool) Run(wg *sync.WaitGroup)
- func (wp *WorkerPool) SetTgBot(tgbot *bot.Bot)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FnParam ¶
type FnParam struct { Logger *slog.Logger Tgbot *bot.Bot Repo repository.Repository Settings *models.Settings }
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, wg *sync.WaitGroup, logger *slog.Logger, repo repository.Repository) (*WorkerPool, error)
func (*WorkerPool) Add ¶
func (wp *WorkerPool) Add(ctx context.Context, settings *models.Settings, execFn ExecutionFn) JobID
func (*WorkerPool) Close ¶
func (wp *WorkerPool) Close() error
func (*WorkerPool) GenerateFrom ¶
func (wp *WorkerPool) GenerateFrom(jobsBulk []Job)
func (*WorkerPool) Run ¶
func (wp *WorkerPool) Run(wg *sync.WaitGroup)
func (*WorkerPool) SetTgBot ¶
func (wp *WorkerPool) SetTgBot(tgbot *bot.Bot)
Click to show internal directories.
Click to hide internal directories.