EasyAPNS:有没有人用大量的通知尝试过吗? [英] EasyAPNS: Has anybody tried it with large amounts of notifications?

查看:134
本文介绍了EasyAPNS:有没有人用大量的通知尝试过吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现 EasyAPNS 在我的应用程序和服务器,目前有2000多个注册的设备的数据库。

I implemented EasyAPNS in my app and server and currently have a database with 2000+ registered devices.

今天我试着将通知发送给所有这些设备和脚本超时。我检查了code(应该已经做得比较早,我知道),它打开了每个消息的连接的我发现的。

Today I tried to send notifications to all of these devices and the script timed out. I checked the code (should've done it earlier, I know) and I discovered it opens a connection for each message.

基本上,这件事绝不会工作,会得到我的IP被禁止,对吧?如何是它甚至有可能,这个问题是不是在谷歌组提及任何地方?显然,没有人尝试过​​这个图书馆有很多通知 - 可这是真的吗?还是我失去了一些东西?

Basically this thing will never work and will get my IP banned, right? How's it even possible that this problem is not mentioned anywhere in the Google group? Apparently nobody tried this library with a lot of notifications -- can this be real? Or am I missing something?

推荐答案

我最终改写了很多code发送消息到APNS的。基本上,而不是通过每个消息循环开放,每一次关闭连接,只需从数据库读取N个消息(可能限制为100),每分钟和一次性给他们。这样做,直到消息表是空的(我用这个cron作业)。我也不得不做更多的工作,因为我需要多个应用程序的支持。

I ended up rewriting a lot of the code that sends the messages to the APNS. Basically instead of looping through each message opening and closing the connection every time, just fetch N messages (probably the limit is 100) from the database every minute and send them in one shot. Do this until the messages table is empty (I used a cron job for this). I also had to do some more work because I needed multiple application support.

我不知道是什么时,他们写道,图书馆EasyAPNS家伙在想。老实说,它并没有在所有帮助 - 它会更好,如果我从头开始编写的APNS code。关于我自己的。如果有人需要帮助修改库,只是在此留言。

I'm not sure what the EasyAPNS guys were thinking when they wrote that library. Honestly, it didn't help at all -- it would have been better if I had written the APNS code from scratch on my own. Should anybody need help in modifying the library, just comment this post.

这篇关于EasyAPNS:有没有人用大量的通知尝试过吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆