-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sent callback #171
Comments
Sadly, this just isn't something we can do reliably. Please see #130 (and also the FAQ) for additional discussion. To recap, the APNs protocol itself never acknowledges successful notifications, so we have no way of telling the difference between a successfully-sent notification, a notification that disappeared into space, or a notification that failed and just hasn't been rejected yet. We wouldn't want to tell listeners that a notification has been sent, but then report the opposite a few milliseconds later if the notification ultimately gets rejected. |
sent means write to netty buffer success. |
Could you please elaborate on the use case you have in mind? I'm still struggling to think of a scenario where knowing about individual writes without knowing about their outcomes would be helpful. That's not to say such a scenario doesn't exist—I just haven't thought of it yet. |
@qifuren1985 Do you intend to use this kind of thing strictly for health/performance monitoring? If so, please let me call your attention to #175. If not, please do let us know so we can make sure we're considering your use case! |
use case: Push message is stored in Redis, when the message has writen to Netty, I need to remove the message from Redis, so I need a callback to do this thing. The reason save message in Redis: If I have 10,000,000 message to push, message add to queue may be only 1 second, but write to Netty need much more time, If program crash when writing to Netty, I will don't know which message has sent. The next time when program resume, I need to resend these failed push. |
If you're trying to control the rate at which notifications are taken from an external source, you might try providing a custom Please note, though, that this won't totally solve your problem (and this is a limitation of the APNs protocol). Because notifications can be rejected after an unknown delay, you could still theoretically "send" thousands of notifications before finding out that an earlier notification was rejected, and all of the subsequent ones need to be resent. Pushy will take care of all of that for you behind the scenes, but I do want to be clear that it's very hard to know when a notification is truly sent. |
when a notification sent, we need do some thing. so maybe we need add sent callback support.
The text was updated successfully, but these errors were encountered: