Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Async? #5

Open
matthijs2704 opened this issue Oct 1, 2016 · 4 comments
Open

Async? #5

matthijs2704 opened this issue Oct 1, 2016 · 4 comments

Comments

@matthijs2704
Copy link
Owner

Maybe add an sync and async way of sending push notifications using GCD. So the end-developer can just pass the payload and not worry about the lag it causes on the server.

Now the end-developer can do that himself of course

@malhal
Copy link

malhal commented May 8, 2017

That could also batch the notifications into one connection to APNS to avoid the mythical IP ban for too many connections.

Another way would just be to install a service could send the notification in a separate process, however that then has cross-platform complications.

@matthijs2704
Copy link
Owner Author

@malhal It should already only use one connection, unless you use multiple VaporAPNS instances :)

@malhal
Copy link

malhal commented May 8, 2017

Oh right, cool then!

I was wondering if you happened to know if Vapor runs on a web server rather than using its built in basic server would that result in multiple processes and hence multiple instances? Thanks

@matthijs2704
Copy link
Owner Author

@malhal It only creates multiple instances if you initiate VaporAPNS inside of the request handler. When you create the VaporAPNS instance in the main.swift (so on server startup) you can use it anywhere in the response but it reuses that same connection

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants