0

I'm trying to use the presence features of PubNub and relay the info received back as a normal message. Below is my subscribe function that is working properly as well as my here_now that doesn't give me anything. I guess what I'm wondering is how and why they differ. Pointers on proper implementation are also of great value.

pubnub.here_now({
  'channel'  => @channel, 
  'callback' => lambda do |x|
## Relay Message
   sendMessage(x)
return true
end
})

pubnub.subscribe({
  'channel'  => @channel, 
  'callback' => lambda do |message|
## Relay Message
   sendMessage(message)        
return true
end
})
oskare
  • 1,061
  • 13
  • 24

1 Answers1

0

For very simple test with what you have provided, you will want to run the subscribe in one ruby script, first, then run the publish script in the here_now script separately.

Craig Conover
  • 4,710
  • 34
  • 59
Geremy
  • 2,415
  • 1
  • 23
  • 27