PHP code example of hyperf-apex / reliability

1. Go to this page and download the library: Download hyperf-apex/reliability library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hyperf-apex / reliability example snippets


#[RateLimit(capacity: 60, refill: 1)]
#[PostMapping(path: '')]
public function store(): ApiResponseDTO

#[Idempotent]
#[PostMapping(path: '')]
public function store(#[FromBody] StoreRequestDTO $request): ApiResponseDTO
bash
composer rf.php vendor:publish hyperf-apex/reliability --id=config
php bin/hyperf.php vendor:publish hyperf-apex/reliability --id=migrations   # 幂等记录表 + 发件箱事件表
bash
php bin/hyperf.php outbox:prune   # 清理超出保留窗口的已成功事件