Class: Telephony::Jobs::PusherEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/telephony/jobs/pusher_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ PusherEvent

Returns a new instance of PusherEvent.



6
7
8
# File 'lib/telephony/jobs/pusher_event.rb', line 6

def initialize(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



4
5
6
# File 'lib/telephony/jobs/pusher_event.rb', line 4

def event
  @event
end

Instance Method Details

#failureObject



14
15
16
17
18
# File 'lib/telephony/jobs/pusher_event.rb', line 14

def failure
  Rails.logger.error "#{self.class}: #{self.as_json}"
  ActiveSupport::Notifications
    .instrument("telephony.agent_offline_failure", self)
end

#performObject



10
11
12
# File 'lib/telephony/jobs/pusher_event.rb', line 10

def perform
  Telephony::PusherEventPublisher.push(@event)
end