Sha256: ee9e1f8a3f34ef3f175b7bc361cba845ede7561adc9805ed276fed1e25382981

Contents?: true

Size: 518 Bytes

Versions: 46

Compression:

Stored size: 518 Bytes

Contents

class StreamNotificationsJob < Hyrax::ApplicationJob
  def perform(users)
    # Do not use the ActionCable machinery if the feature is disabled
    return unless Hyrax.config.realtime_notifications?
    Array.wrap(users).each do |user|
      mailbox = UserMailbox.new(user)
      Hyrax::NotificationsChannel.broadcast_to(user,
                                               notifications_count: mailbox.unread_count,
                                               notifications_label: mailbox.label)
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/jobs/stream_notifications_job.rb
hyrax-2.9.5 app/jobs/stream_notifications_job.rb
hyrax-2.9.4 app/jobs/stream_notifications_job.rb
hyrax-2.9.3 app/jobs/stream_notifications_job.rb
hyrax-2.9.2 app/jobs/stream_notifications_job.rb
hyrax-2.9.1 app/jobs/stream_notifications_job.rb
hyrax-2.9.0 app/jobs/stream_notifications_job.rb
hyrax-2.8.0 app/jobs/stream_notifications_job.rb
hyrax-2.7.2 app/jobs/stream_notifications_job.rb
hyrax-2.7.1 app/jobs/stream_notifications_job.rb
hyrax-2.7.0 app/jobs/stream_notifications_job.rb
hyrax-2.6.0 app/jobs/stream_notifications_job.rb
hyrax-3.0.0.pre.rc1 app/jobs/stream_notifications_job.rb
hyrax-3.0.0.pre.beta3 app/jobs/stream_notifications_job.rb
hyrax-2.5.1 app/jobs/stream_notifications_job.rb
hyrax-2.5.0 app/jobs/stream_notifications_job.rb
hyrax-3.0.0.pre.beta2 app/jobs/stream_notifications_job.rb
hyrax-2.4.1 app/jobs/stream_notifications_job.rb
hyrax-3.0.0.pre.beta1 app/jobs/stream_notifications_job.rb
hyrax-2.4.0 app/jobs/stream_notifications_job.rb