Download the PHP package yoshi2889/tasks without Composer

On this page you can find all versions of the php package yoshi2889/tasks. 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 tasks

Task Controller

Build Status Scrutinizer Code Quality Scrutinizer Code Coverage Latest Stable Version Latest Unstable Version Total Downloads

Simple task controller supporting multiple types of tasks.

Installation

You can install this class via composer:

Usage

Create an instance of TaskController and add any instance of TaskInterface to it:

Repeatable Tasks

A RepeatableTask instance is a Task which runs its child task on an interval. Before a RepeatableTask starts running the child task, it first checks if its expiry time has passed. If it has not, it will not run the task.

For example, to create a new RepeatableTask that runs the previous CallbackTask every 5 seconds:

This task would only start running after the 10 seconds defined before in the CallableTask have passed.

Cancelling Tasks

Tasks can be cancelled prematurely. How a cancel is handled depends on the task type. For instance, if we cancel a RepeatableTask, it will internally cancel its child task and stop repeating, after which it will be discarded:

However, if we were to cancel a CallbackTask, it will just be put in a state where it can no longer be run by the TaskController and will thus be discarded on the next run.

TaskController must never cancel tasks on its own, this is up to the user.

Discarding Tasks

By default, a Task which does not return a new Task on its run() method will be discarded. However, if a Task does pass back a new Task, the original Task itself gets discarded, but the Task instance which is passed back will be added in its place. We can observe this with the following snippet:

Discarded tasks will be removed from the TaskController.

Implementing custom Tasks

The TaskController accepts any class that implements the TaskInterface interface. This interface contains the following methods:

License

This code is released under the MIT License. Please see LICENSE to read it.


All versions of tasks with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
react/event-loop Version ^1.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 yoshi2889/tasks contains the following files

Loading the files please wait ....