
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/litterfeldt/go-sns-mobile-pusher
##In short Go SNS Mobile Pusher allows you to have one endpoint for all push notifications agnostic of device type. It then does magic and sends the push via AWS SNS.
##Slightly more in depth Go SNS Mobile Pusher has multiple structural benefits to any other in-app implementation of GCM/APNS.
#Setup
##Heroku Create a Heroku app and make sure it has the go buildpack to use. Next, set up env for that app. Required config vars are:
Now push the repo to that Heroku app. Ready to go. #Concurrency The worker environment variable dictates how many workers the process will start up. Every request is received and cached in an in-memory queue that the workers read from. The more workers the faster the queue will be emptied. This gives the opportunity to handle surges in traffic without slowing down the rest of the stack. The limit for the queue is set to a high value and until that value is reached inbound requests will not be blocked. The amount of workers you should use should be proportionate to how much CPU, memory and network bandwidth is available for the process. Arbitrarily any number from 1-10 should be safe on most machines, including Heroku 1x dynos, any number higher should be load-tested before being run in production. #Usage The app comes with a rest API that take http operations. Check the examples folder for code.
##Send push to a device
POST http://<url>/send
Header: Auth-Token: <Token>
Body:
{
"push_token": "<push_token>",
"message": "<message>",
"url": "<app://profile>",
"unread_count": "<int as a string>",
}
Returns:
Status: 200
{ }
You send pushes to devices via push tokens while the process figures out what device brand it is and how to send it.
##Status
GET http://<url>/status
Header: Auth-Token: <Token>
Returns:
{
"jobs_in_queue": 0,
"running": true,
"workers": 8
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.