Download the PHP package davidyan/asyntask without Composer

On this page you can find all versions of the php package davidyan/asyntask. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package asyntask

PHP异步任务队列管理器asyntask

asyntask是一个轻量级异步任务队列管理器,支持实时,定时,长时和周期任务。

项目由来

本项目最初用于通知推送。例如用户发布评论,需要推送一条push给原作者。而到苹果的服务器的请求时间较长,如果等待苹果服务器的返回结果,则整个发布评论的接口的响应时间就太长了。因为推送push早1秒晚1秒对用户基本没影响,所以当用户发布评论时,只要数据到数据库,即可返回。与此同时创建一条异步任务,在1秒内给用户推送push。这样既保证了接口的响应速度,又不影响用户体验。该项目已经在线上环境运行1年多,执行了累计8千万条命令,运行稳定。

优点

缺点

并非真正实时,秒级误差。

安装

下载源码

直接使用:

命令下载到本地。

也可以点击 https://github.com/spetacular/asyntask/archive/master.zip 下载最新内容的压缩包,然后解压。

通过 composer 来安装

在你的 composer 项目中的 composer.json 文件中,添加这部分:

然后执行composer install。调用示例如下:

配置

1.asyntask的数据默认存储在Mysql数据库里,因此需要更改config.php里的配置:

2.导入数据表 将resource文件夹里的db.sql导入数据库中。

3.配置健康检查脚本 run.sh定期检查异步任务的运行状况,如果挂了,cron_asyn_task.php脚本。

然后配置CronTab。运行crontab -e,然后添加一行:

使用方式

管理后台

自带管理后台,可以轻松添加、编辑、删除、搜索任务。代码在https://github.com/spetacular/asynadmin,请自行部署。 管理后台截图

编程方式

可以集成到项目中,完整使用示例见test.php。 例如添加周期任务:

周期任务示例

每天执行:day 1 hour 0 minute 0 每天零点执行

每小时执行:day 0 hour 1 minute 5 每小时的5分执行

每隔若干分钟执行:day 0 hour 0 minute 5 每隔5分钟执行

asyntask

A lightweight asynchronous queue manager, supporting real-time, timing, long-term, periodic tasks.


All versions of asyntask with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davidyan/asyntask contains the following files

Loading the files please wait ....