notamedia/bitrix-agent-manager

此包已被放弃,不再维护。作者建议使用 notamedia/console-jedi 包。

Bitrix 的代理管理器

1.0.0-beta 2016-01-06 09:36 UTC

This package is not auto-updated.

Last update: 2019-08-19 09:33:24 UTC


README

Build Status Latest Stable Version Total Downloads License

此模块有助于在 Bitrix 的代理上创建简单的工人。

安装

composer require notamedia/bitrix-agent-manager

使用方法

扩展抽象类 Agent 以创建您的简单工人。例如

use Notamedia\AgentManager\Agent;

class SimpleWorker extends Agent
{
    protected $recurring = false; // Agent is not recurring.
    protected $parameter;
    
    public function __construct($parameter)
    {
        parent::__construct();
        
        $this->parameter = $parameter;
    }
    
    protected function init()
    {
        // Preparatory operations.
    }
    
    protected function execute()
    {
        // The basic logic of worker.
    }
}

并在 Bitrix 中注册您的代理

Agents list