** Copyright (C) 2001-2023 Zabbix SIA
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// performer interface provides common access to plugin tasks
type performer interface {
// returns the task plugin
setPlugin(p *pluginAgent)
// performs the task, this function is called in a separate goroutine
// reschedules the task, returns false if the task has been expired
reschedule(now time.Time) error
// returns time the task has been scheduled to perform
// returns task index in plugin task queue
// sets task index in the plugin task queue
// returns true if the task is active
// deactivates task, removing from plugin task queue if necessary
// true if the task has to be rescheduled after performing
// true if item key equals
isItemKeyEqual(itemkey string) bool
type performerHeap []performer
func (h performerHeap) Len() int {
func (h performerHeap) Less(i, j int) bool {
return h[i].getScheduled().Before(h[j].getScheduled())