Scalable, Delayed PHP Processing

后端 未结 15 954
长情又很酷
长情又很酷 2020-12-08 01:41

I\'m working on an online PHP application that has a need for delayed PHP event. Basically I need to be able to execute arbitrary PHP code x many seconds (but it could be da

15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 02:13

    I recommend also the queue strategy, but you seem to dislike using the database as queue. You've got a XMPP infrastructure, so leverage it: use a pubsub Node and post your events to this node. Pubsub can optionally be configured to store unfetched items in a persistent way.

    Your daemon process (no matter what language) can fetch all stored items at startup time and subscribe to changes to get notified about incoming actions. This way you can solve your problem in an elegant, asynchronous way.

提交回复
热议问题