4 Star 23 Fork 12

my_teste / PHP Generator Yield Demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PHP Generator Yield Demo

介绍

PHP 生成器 yield 语法Demo

yield-thread 文件夹内是一个用 php yield 参照Java Thread 写的一个 类多线程调度器

yield-scheduler 文件夹内是 在PHP中使用协程实现多任务调度 文章中部分代码的整理。

当前目录的代码,是对 yield 的基础用法的探究。

使用说明

  • PHP >= 5.5
## 运行可得什么才算得上是 生成器
$ php ./whatIsGenerator.php

## 生成器的 方法 探究
$ php ./generatorMethod.php
MIT License Copyright (c) 2020 my_teste Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

PHP 生成器 yield 语法Demo 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/xupaul/PHP-generator-yield-Demo.git
git@gitee.com:xupaul/PHP-generator-yield-Demo.git
xupaul
PHP-generator-yield-Demo
PHP Generator Yield Demo
master

搜索帮助