PHPackages                             got/tarth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. got/tarth

ActiveLibrary[Queues &amp; Workers](/categories/queues)

got/tarth
=========

请求异步化框架

1.0.8(9y ago)5331[1 issues](https://github.com/pythias/Tarth/issues)[1 PRs](https://github.com/pythias/Tarth/pulls)MITPHPPHP &gt;=5.3

Since Nov 18Pushed 9y ago2 watchersCompare

[ Source](https://github.com/pythias/Tarth)[ Packagist](https://packagist.org/packages/got/tarth)[ Docs](https://github.com/pythias/Tarth)[ RSS](/packages/got-tarth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Tarth
=====

[](#tarth)

`Tarth` is an asynchronous, concurrent, distributed task process framework.

Requires
--------

[](#requires)

- PHP 5.3 or Higher
- A POSIX compatible operating system (Linux, OSX, BSD)
- POSIX and PCNTL extensions for PHP
- Redis extensions

Features
--------

[](#features)

- Asynchronous API callback, multi API callback
- Support timing callback, similar to crontab, but include retry, security, controllable options
- Support task number limit, speed controller
- Support callback priority level
- Stark Features

Usage
-----

[](#usage)

You can use `Stark` to start the timer and processor daemon:

```
php vendor/bin/stark -f scripts/timer.ini
php vendor/bin/stark -f scripts/processor.ini
```

Daemon
------

[](#daemon)

Use [Stark](https://github.com/pythias/Stark)

Task Tools
----------

[](#task-tools)

### API

[](#api)

Class: \\Tarth\\Tool\\Task

#### Create

[](#create)

```
static public function createApiTask($url, $method = 'GET', $params = array())
static public function createEmailTask($to, $subject, $message)
```

#### Control

[](#control)

```
static public function atomTask()
static public function exec()
static public function closeTask($taskId)
```

#### Security

[](#security)

```
static public function getTarthHeader(TaskInterface $task)
static public function isRequestFromTarth()
```

### Samples

[](#samples)

#### Normal task

[](#normal-task)

```
php tests/normal_api_task.php
```

```
