** Copyright (C) 2001-2025 Zabbix SIA
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
** 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 Affero General Public License for more details.
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
"golang.zabbix.com/sdk/plugin"
// pluginAgent manages plugin usage
type pluginAgent struct {
// queue of tasks to perform
// maximum plugin capacity
// force active check on first configuration
forceActiveChecksOnStart bool
// refcount us used to track plugin usage by clients
// usrprm is used to indicate that plugin is user parameter
// peekTask() returns next task in the queue without removing it from queue or nil
// if the queue is empty.
func (p *pluginAgent) peekTask() performer {
// popTask() returns next task in the queue and removes it from queue.
// nil is returned for empty queues.
func (p *pluginAgent) popTask() performer {
func (p *pluginAgent) enqueueTask(task performer) {