wyrihaximus / recoil-promise-coroutine-wrapper
围绕 WyriHaximus/recoil-queue-caller(-pool) 的简单 API
1.0.0
2019-05-24 15:19 UTC
Requires
- php: ^7.2
- wyrihaximus/recoil-queue-caller: ^2.1
- wyrihaximus/recoil-queue-caller-pool: ^1.2
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-03 19:17:53 UTC
README
安装
通过 Composer 安装,使用以下命令,它将自动检测最新版本并将其绑定到 ^
。
composer require WyriHaximus/recoil-promise-coroutine-wrapper
用法
// Have the event loop ready $loop = Factory::create(); // Create the wrapper from the event loop, internally this will set up all the required comonents $wrapper = PromiseCoroutineWrapper::createFromLoop($loop); // Execute a coroutine and get the result through a promise (the irony) $result = $wrapper->call(function (LoopInterface $loop, int $wait) { yield timedPromise($loop, $wait); return $wait; }, $loop, $wait)
许可证
MIT 许可证 (MIT)
版权所有 (c) 2019 Cees-Jan Kiewiet
特此免费授予任何获得此软件及其相关文档文件(以下简称“软件”)副本的人使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本的权利,并允许获得软件副本的个人进行此类操作,但受以下条件约束
上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。
软件按“原样”提供,不提供任何形式的保证,无论是明示的还是暗示的,包括但不限于适销性、适用于特定目的和无侵犯性的保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任负责,无论这些责任是因合同、侵权或其他原因而引起的,无论与软件或其使用或其他交易有关。