Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 41ca9e01f8
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (39 sloc) 1.126 kB
require 'tentd/notifications'
require 'sidekiq'
module TentD
class Notifications
def self.queue_job(job, msg)
const_get(job.to_s.split('_').map(&:capitalize).push('Worker').join).perform_async(msg)
end
class TriggerWorker
include Sidekiq::Worker
def perform(msg)
Model::NotificationSubscription.notify_all(msg['type'], msg['post_id'])
end
end
class NotifyWorker
include Sidekiq::Worker
def perform(msg)
Model::NotificationSubscription.notify(msg['subscription_id'], msg['post_id'])
end
end
class NotifyEntityWorker
include Sidekiq::Worker
def perform(msg)
Model::NotificationSubscription.notify_entity(msg['entity'], msg['post_id'])
end
end
class UpdateFollowingProfileWorker
include Sidekiq::Worker
def perform(msg)
Model::Following.update_profile(msg['following_id'])
end
end
class ProfileInfoUpdateWorker
include Sidekiq::Worker
def perform(msg)
Model::ProfileInfo.create_update_post(msg['profile_info_id'])
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.