hyperf redis延迟队列

        $container = ApplicationContext::getContainer();

        $redis = $container->get(Redis::class);

        $timestamp = time() + $delay_seconds;
        return $redis->zAdd($queue_key, $timestamp, json_encode(["data_key":"data_value"]));
posted @ 2024-11-07 00:22  冯元春  阅读(3)  评论(0编辑  收藏  举报