Download the PHP package sunvalley-technologies/php-task-manager without Composer

On this page you can find all versions of the php package sunvalley-technologies/php-task-manager. 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 php-task-manager

PHP Task Manager

Build Status

A task manager that helps delegating work to background be it for HTTP requests or event loops.

This documentation is mostly introductory only. Majority of the classes, interfaces and methods of this library is documented and gives more information on specific details.

Installing

composer require sunvalley-technologies/php-task-manager

Usage

Task Manager

This library provides a manager that handles child processes and delegation of tasks to them and also provides an interface for tasks to be defined and passed to these children from different contexts.

The task manager server can be used standalone or you can attach it to an applications event loop.

A standalone version can be started like following:

``

Note that this manager won't do much as InMemoryTaskQueue has no way to receive a task from anywhere but the same application hence closure is just stopping the loop as soon as the task is resulted.

You can use \SunValley\TaskManager\TaskQueue\RedisTaskQueue to have a Redis backend to send tasks from different contexts.

On above example task ExampleTask should be implementing \SunValley\TaskManager\TaskInterface. There is an abstract class \SunValley\TaskManager\Task\AbstractTask that makes easier to generate task classes.

Manager considers all tasks as synchronous by default unless a task implements \SunValley\TaskManager\LoopAwareInterface. This should be used carefully as async tasks are generally fire and forget and result of a task is only controlled by passed ProgressReporter instance. This means that async tasks should also properly handle their errors. From managers point of view, it is important to properly know that a task is sync or async as manager can push more async tasks to a worker that is already doing another async work. This is an important point to consider while building tasks. For this reason use the helper trait with your async tasks \SunValley\TaskManager\Task\AsyncTaskTrait. You should avoid using await or any other promise waiting method on tasks body for the loop that is passed when LoopAwareInterface is defined on the task as the task's run method is started on the passed loop.

The tasks run method receives a progress reporter object that can be used to send progress reports and also need to be used to finalize the task. Generally, you always want to call finishTask at the end of your logic as calling this method will make the worker as task completed for the manager. The exceptions thrown in the run method are caught and reported to manager with failTask($error). If desired, progress information can be sent by calling setMessage, setCompletionTarget, setCompletion can be used to send progress information, however this only works for Async Tasks. Calling these methods from a child informs manager and also manager informs task storage to update information if necessary.

For more examples, check the integration tests in this library.

Service Manager

ServiceManager provides a way to run tasks like services. Each task is expected to be long running task and if it fails, it is restarted according to given restart policy.

A sample can be found in the \SunValley\TaskManager\Tests\ServiceManagerTest

Framework Integration

Symfony Bundle


All versions of php-task-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-json Version *
symfony/options-resolver Version ^3.0|^4.0|^5.0
wyrihaximus/react-child-process-pool Version ^1.1.0
eloquent/enumeration Version ^5.0|^6.0
eloquent/pops Version ^3.0|^4.0
evenement/evenement Version ^3.0
clue/redis-react Version ^2.2
clue/block-react Version ^1.3
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 sunvalley-technologies/php-task-manager contains the following files

Loading the files please wait ....