-
Notifications
You must be signed in to change notification settings - Fork 79
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
Background Job support #29
Comments
Hi @sumitngupta, As activity_notification gem, currently background job API with ActiveJob is only supported for sending notification email. It is provided as send_later option of Notification API ( On the other hand, we can use background job tools such as delayed_job with activity_notification.
Actually we are using activity_notification with delayed_job like this. Of course, I would appreciated it if you could send us pull request to enhance "Asynchronous Notification API" with ActiveJob for better activity_notification. Regards, |
@sumitngupta Did you get anywhere with this. I'd love to see this in the library too since creating notifications inline is a big performance issue. Obviously you can get around it by setting |
Is there any work going on n this? |
Not yet. But I would like to make notify method work as active_job's job. This will not be a so big enhance. I would appreciate it if you could contribute this feature. I will also try do this when I have time. |
Apologies @adambedford for completely missing the question to me. We moved away from ActivityNotification in the end since our domain problem required something slightly different (stupid domain complexities). We ended up using the ".delay" method until we moved over to our own notifications system. |
Hi, See the following REDME to try it. Thanks! |
Just released as new version 1.7.0. |
Hello!
First off, the gem looks amazing. We just ran through a test integration and we're ecstatic that it covered all our needs and more. We're going to be fully integrating it this week but one thing we noticed was that when a notification is triggered its done entirely inline. This would fall over performance wise for us since a single comment could cause hundreds of notification records inserts. Looking through the API it looks pretty straight forward to integrate some ActiveJob queueing to handle the notification creation for these three methods:
https://github.com/simukappu/activity_notification/blob/master/lib/activity_notification/models/concerns/notifiable.rb#L240
https://github.com/simukappu/activity_notification/blob/master/lib/activity_notification/models/concerns/notifiable.rb#L260
https://github.com/simukappu/activity_notification/blob/master/lib/activity_notification/models/concerns/notifiable.rb#L280
I was going to create an option to enable / disable whether it used ActiveJob's or inline (as it currently is implemented).
First question... Is this something thats already in place but I'm just blind and missed it?
Second question in case the answer to the first is that its not in fact already in the gem.. is this something you'd want / appreciate as a pull request (presuming test coverage is in place and all the other responsible open source requirements are handled) ? I ask only because it might influence how we patch in the background job support.
Again, fantastic gem and looking forward to exploring all its goodies!
Cheers,
Sumit
The text was updated successfully, but these errors were encountered: