Last active
May 23, 2020 11:24
-
-
Save SahSantoshh/cb7891cb2e55bda7d2e99a8f43662581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def subscribe | |
EM.run do | |
# Subscribe to the account PushTopic. | |
account_topic = ENV['ACCOUNT_PUSH_TOPIC_NAME'] | |
contact_topic = ENV['CONTACT_PUSH_TOPIC_NAME'] | |
@client.subscription "/topic/#{account_topic}" do |message| | |
Logger.new(LOG_PATH).info('Account Received') | |
message.inspect | |
end | |
# Subscribe to the contact PushTopic. | |
@client.subscription "/topic/#{contact_topic}" do |message| | |
Logger.new(LOG_PATH).info('Contact Received') | |
message.inspect | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment