PHPackages                             yurunsoft/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. yurunsoft/xcoroutine

ActiveLibrary

yurunsoft/xcoroutine
====================

The PHP Coroutine.

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

Since Aug 15Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

XCoroutine
==========

[](#xcoroutine)

XCoroutine, the PHP Coroutine.

此仓库版本为宇润基于 [xtlsoft/XCoroutine](https://github.com/xtlsoft/XCoroutine) 项目开发，增加协程挂起、恢复功能。

本项目遵循 MIT 开源协议发布，并提供免费使用。

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

[](#install-安装)

```
composer require yurunsoft/xcoroutine
```

Intro 介绍
--------

[](#intro-介绍)

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

Usage 使用
--------

[](#usage-使用)

1. 初识yield 例子： ```
