Home  >  Q&A  >  body text

php - I want to use redis to queue up WeChat notifications, how should I start?

1. I want to do one-click shipping in the background, and then queue up the orders belonging to this pick-up point to send WeChat notifications.
2. WeChat notifications and one-click shipping have been completed, and I just need to queue up and send notifications.

phpcn_u1582phpcn_u15822726 days ago488

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-05-27 17:44:55

    1. Save in redis queue.

    2.php provides a non-timeout interface. The function of this interface is to loop to pop the data in the queue and send notifications.

    Why use redis

    1. Queue cache, high speed, convenient and simple maintenance.

    2. The queue form is relatively controllable, and pushing to third parties is a timeout behavior, so it is better to make a separate request interface to submit. Or you can make a crond scheduled task and submit it automatically.

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-27 17:44:55

    First save the production data into redis, and then the consumer consumes the data and sends a WeChat notification.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-27 17:44:55

    Queuing, a better choice is message queue, such as RabbitMQ, ActiveMQ, etc.

    reply
    0
  • Cancelreply