pushy
pushy copied to clipboard
Add request timeout
The problem: in case of network failures some requests get stuck until the APNS connection restores.
Steps to reproduce:
- Make multiple (1000 or so) simultaneous (push) requests.
- Break APNS connectivity (or shut down emulator).
- Wait for a couple of minutes.
- Restore network (or start emulator).
At step (2) some futures complete with exception, but some get stuck until the (4) step.
With restored network those "stuck" futures complete as usual.
I guess throwing something like TimeoutException would be a more predicable/reliable behaviour.
Another option is apnsClient.send(...).orTimeout(...), but it may lead to resource leaks and it doesn't actually cancel the request.
Maybe related: #433 and #444 (drops write timeout).
What do you think about it?