承接 taknone/asyncio 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

taknone/asyncio

最新稳定版本:v0.0.8

Composer 安装命令:

composer require taknone/asyncio

包简介

A high-performance async framework for PHP supporting Swoole and Revolt loops

README 文档

README

Asyncio

Asyncio

Modern Async Foundations for PHP

High-performance asynchronous framework for PHP with support for Revolt and Swoole

✨ Features

  • High-performance asynchronous execution for modern PHP projects
  • Event-loop driven architecture
  • Compatible with Revolt and Swoole
  • Fiber-friendly async design
  • Non-blocking file, socket, and stream utilities
  • Lightweight helpers for building async-first applications
  • MIT licensed and easy to integrate into existing codebases

🛠️ Requirements

  • PHP 8.4 or higher
  • revolt/event-loop : ^1.0
  • Optional : ext-swoole for high-performance coroutine support
  • Optional : ext-pcntl for better signal handling

📦 Installation

Install via Composer :

composer require taknone/asyncio

Optional Extensions

pecl install swoole
Extension Purpose
Swoole High-performance coroutine runtime
PCNTL Better signal handling

🏁 Getting Started

The library is designed to be used with async-friendly code, event loops, Fibers, and non-blocking I/O

<?php

require 'vendor/autoload.php';

use function Tak\Asyncio\async;
use function Tak\Asyncio\delay;

use Tak\Asyncio\TimeoutCancellation;

$future = async(function () : void {
    echo 'Background task initialized' , PHP_EOL;
    delay(1.5);
    echo 'Background task completed' , PHP_EOL;
});

echo 'Main execution continues without blocking.' , PHP_EOL;

$future->await(new TimeoutCancellation(2));

echo 'Future resolved successfully' , PHP_EOL;

💈 Project Structure

This package is autoloaded through PSR-4 with the Tak\\Asyncio\\ namespace and includes helper files for :

  • src/functions.php
  • src/File/functions.php
  • src/Socket/functions.php
  • src/ByteStream/functions.php

That layout is ideal for helper-based async APIs that cover core runtime, file, socket, and stream operations

⁉️ Why Asyncio

Asyncio is built for developers who want a clean async layer without sacrificing PHP performance or portability. It is a good fit for :

  • async services
  • background workers
  • socket servers
  • file streaming
  • high-concurrency I/O
  • coroutine-based applications

⚡ Usage Notes

  • Use Revolt when you want a standards-friendly event loop
  • Use Swoole when you want coroutine-based high-performance execution
  • Keep I/O non-blocking to get the best results
  • Prefer async helpers instead of direct blocking calls inside loop-driven code

Contributing

Contributions are welcome. Please keep changes consistent with the existing architecture, naming style, and async-first design

📜 License

This project is licensed under the MIT License

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固