-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
local_callback = Pubnub::SubscribeCallback.new(
message: ->(envelope) {
request = envelope.result[:data][:message]
Rails.logger.info("subscribe: RECEIVED MESSAGE - #{request}")
if request["error"].present?
raise StandardError.new("failed to process message")
end
},
status: lambda do |envelope|
if envelope.status[:code] != 200
Rails.logger.error("subscribe: Pubnub error (#{envelope.status[:category]}): #{envelope.status[:server_response].body.strip}.")
else
Rails.logger.info("subscribe: subscribed to #{envelope.status[:subscribed_channels]} with uuid #{envelope.status[:config][:uuid]}")
end
end
)
pubnub.add_listener(callback: local_callback)
pubnub.subscribe(
channels: channels
)https://github.com/pubnub/ruby/blob/v4.2.5/lib/pubnub/subscriber.rb#L288
When application raise's an exception inside SubscribeCallback pubnub is silently ignoring it.
Metadata
Metadata
Assignees
Labels
No labels