tourze/async-contracts
最新稳定版本:1.0.0
Composer 安装命令:
composer require tourze/async-contracts
包简介
异步
README 文档
README
A simple contract package that provides interfaces for asynchronous messaging in PHP applications. This package defines the basic contract for async message handling without any implementation details.
Installation
composer require tourze/async-contracts
Quick Start
This package provides a base interface for async message handling:
<?php use Tourze\AsyncContracts\AsyncMessageInterface; // Implement the interface in your async message classes class MyAsyncMessage implements AsyncMessageInterface { // Your implementation here }
Usage
The AsyncMessageInterface serves as a marker interface for async message objects. It currently contains no methods, allowing maximum flexibility for implementers to define their own message structure.
<?php namespace App\Messages; use Tourze\AsyncContracts\AsyncMessageInterface; class UserRegistrationMessage implements AsyncMessageInterface { public function __construct( private string $userId, private string $email ) {} public function getUserId(): string { return $this->userId; } public function getEmail(): string { return $this->email; } }
Requirements
- PHP 8.1 or higher
Testing
./vendor/bin/phpunit packages/async-contracts/tests
License
This package is open-source software licensed under the MIT license.
统计信息
- 总下载量: 12.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 20
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-03