【问题标题】:Laravel 5.1, Return response to user, then excute some code [closed]Laravel 5.1,向用户返回响应,然后执行一些代码 [关闭]
【发布时间】:2015-09-04 00:37:37
【问题描述】:

故事

我正在使用使用 GCM 向用户发送通知的 NotificationPusher。 连接谷歌服务器并等待响应需要一些时间。

所以,我不希望我的用户等到发送通知,我希望他得到回复(假设他成功评论了帖子) . 然后,-After response- 通知被发送给帖子被评论的用户。

怎么做,我快要疯了

【问题讨论】:

    标签: php android laravel google-cloud-messaging laravel-5


    【解决方案1】:

    您可以使用队列。当用户发表评论时,将事件添加到队列中。 队列由 cron 解析(使用 Laravel 的命令)。

    【讨论】:

      猜你喜欢
      • 2020-09-11
      • 1970-01-01
      • 2012-09-27
      • 1970-01-01
      • 1970-01-01
      • 2016-03-08
      • 1970-01-01
      • 1970-01-01
      • 2012-01-22
      相关资源
      最近更新 更多