PHPackages                             xtlsoft/xcoroutine - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xtlsoft/xcoroutine

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xtlsoft/xcoroutine
==================

The PHP Coroutine.

v0.1.1-stable(8y ago)8224MITPHPPHP &gt;=5.5

Since Aug 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xtlsoft/XCoroutine)[ Packagist](https://packagist.org/packages/xtlsoft/xcoroutine)[ RSS](/packages/xtlsoft-xcoroutine/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

XCoroutine
==========

[](#xcoroutine)

XCoroutine, the PHP Coroutine.

install 安装
----------

[](#install-安装)

```
composer require xtlsoft/xcoroutine
```

Intro 介绍
--------

[](#intro-介绍)

- Task: 任务实例。您可以向里面传入一个Generator，然后通过我们的封装对他进行操作。
- Scheduler: 多任务执行封装。您可以往里面add许多Task，然后执行。每个Task有唯一的ID，一个Task进行部分计算调用yield后，让下一个Task进行计算，以此循环，实现多任务管理。
- SystemCall: Task之间和Task与Scheduler之间传递数据、互相操作的接口。
- DynamicObject: 动态编程类，让你的类支持动态定义/销毁变量和方法。

Usage 使用
--------

[](#usage-使用)

1. 初识yield 例子： ```
