Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 325 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 325 Bytes

hello-sequence

基于snowflake算法的发号器

  • 安装依赖 pecl install apcu && pecl install swoole && composer install

  • 启动服务 php start.php

  • 获取id

$redis = new Predis\Client([ 'scheme' => 'tcp', 'host' => '0.0.0.0', 'port' => 9999, ]);

$id = $redis->executeRaw(['sequence']);