Comments (4)
I believe other gems that have tried to fulfill this requirement have gone the route of daemonizing the connection, sounds like a lot of work for low return. Maybe if you are sending hundreds or thousands of APNs then houston is a good fit but if you're planning on sending millions then you might want a service?
@matt I'd love to hear your thoughts on this it's something I've wondered about too.
from houston.
I don't think it'd be much work. You would need two hashes in Houston::Connection -- one for the socket
variable and one for the ssl
variable. The key to the hashes would be the options
parameter.
from houston.
For those interested, the grocer gem attempts to reuse connections to Apple's servers.
from houston.
There's nothing inherently wrong with how Houston does its connection opening / closing—in fact, it's a Ruby convention to have a block parameter yielded to between setup and destroy (e.g. File#open
).
Houston::Client
doesn't attempt to do anything smart with pushing messages, as it's optimized for ease-of-use. However, if you wanted to keep the connection alive, you could rather easily make it so that the block executes indefinitely, keeping the connection open. This feels like the right approach anyway, as async / runloop / eventing code varies quite a bit across different applications (it may be useful to have a few documented examples of Houston integrating with something like Resque or Rails 4.0 queue)
All of that said, if you or anyone had a pull requests with suggestions on how this could be done better, I'd definitely like to see that.
from houston.
Related Issues (20)
- Usage with APNs Authentication Key .p8 file HOT 8
- Set title HOT 2
- Cannot pass content-available = 0 HOT 2
- How Does Houston Encode Push Tokens? HOT 1
- Exception sending notification: password must be at least 4 bytes HOT 6
- Where do you recommend we store the pem key? HOT 3
- Should support multi-topics certificate? HOT 2
- setting notification.mutable_content = true causes the notification to not be sent HOT 2
- Exception sending notification: getaddrinfo: nodename nor servname provided, or not known HOT 2
- Should use apns-priority:5 instead of an empty sound string for silent push notificaitons HOT 2
- Getting nil back with no errors when APN.push(notification) and notification is not delivered. HOT 14
- My APN are rate limited to one per 20-25 seconds HOT 1
- Changelog
- Where I can find the CI service? HOT 2
- apns-push-type header
- iOS 13 requires new headers to the APNS HOT 4
- APNs will no longer support the legacy binary protocol as of November 2020 HOT 11
- Cannot send silent notifications via CLI
- Expiry field is not documented HOT 2
- Send notification to many device tokens at once
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from houston.