承接 job-runner/symfony-notifier-adapter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

job-runner/symfony-notifier-adapter

最新稳定版本:1.7.0

Composer 安装命令:

composer require job-runner/symfony-notifier-adapter

包简介

README 文档

README

Build Status Type Coverage Type Coverage Latest Stable Version License

This package provides a symfony/notifier adapter for JobRunner.

Installation

composer require job-runner/symfony-notifier-adapter

Usage

<?php

declare(strict_types=1);

use JobRunner\JobRunner\Job\CliJob;
use JobRunner\JobRunner\Job\JobList;
use JobRunner\JobRunner\CronJobRunner;
use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransport;
use Symfony\Component\Notifier\Channel\ChatChannel;
use Symfony\Component\Notifier\Notifier;
use JobRunner\JobRunner\SymfonyNotifier\SymfonyNotifierEventListener;

require 'vendor/autoload.php';


$rocket = new RocketChatTransport('mytoken', '#mychannel');
$rocket->setHost('chat.myhost.com');
$chat     = new ChatChannel($rocket);
$notifier = new Notifier(['chat' => $chat]);

$jobCollection = new JobList();
$jobCollection->push(new CliJob('php ' . __DIR__ . '/tutu.php', '* * * * *'));

CronJobRunner::create()
    ->withEventListener((new SymfonyNotifierEventListener($notifier))->withNotificationChannelFail(['chat']))
    ->run($jobCollection);

统计信息

  • 总下载量: 16k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-29