Sha256: a16343307f0dd411e7bf7daa88861efa43b248996107bb1b93ec0428172ecb6c

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

$LOAD_PATH << '../'
require 'yalgaar'

########################################################Callbacks#########################################	
#Callback for Connection
$connectionCallback = -> (arg0) { connectionCallback(arg0) } 
def connectionCallback(arg0)
	puts arg0
end

$subscribeReturnMessageCallback = -> (arg0) { subscribeReturnMessageCallback(arg0) } 	
def subscribeReturnMessageCallback(message)
	#No a presence must me json & enable 
	puts "subscribeReturnMessageCallback@@@"
	puts message
	#TODO
end

$errorMsgCallback = -> (arg0) { errorMsgCallback(arg0) } 
def errorMsgCallback(message)
	puts "errorMsgCallback"
	puts message
	#TODO
end

$presenceMessageCallback = -> (arg0) { presenceMessageCallback(arg0) } 
def presenceMessageCallback(message)
	#must me json & enable 
	puts "presenceMessageCallback"
	puts message
	#TODO
end

########################################################User Area for Calling Pub-sub######################################			
yalgaarClient = Yalgaar.new

#yalgaarConnect(clientKey,isSecure,$connectionCallback)#
yalgaarClient.yalgaarConnect("ck-47046d75cf64402f",1,$connectionCallback)
sleep 2

#yalgaarSubcribe(channel/channels,$subscribeReturnMessageCallback,$presenceMessageCallback,$errorMsgCallback)#
#channel
yalgaarClient.yalgaarSubcribe("SLS",$subscribeReturnMessageCallback,$presenceMessageCallback,$errorMsgCallback)
#channels
channels=["abc","xyz"]
yalgaarClient.yalgaarSubcribe(channels,$subscribeReturnMessageCallback,$presenceMessageCallback,$errorMsgCallback)
sleep 2
#yalgaarUnSubcribe(channel/channels)#
#channel
yalgaarClient.yalgaarUnSubcribe("SLS")
#channels
yalgaarClient.yalgaarUnSubcribe(channels)
########################################################END####################################################################

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yalgaar-1.0.2 examples/subcribe.rb
yalgaar-1.0.1 examples/subcribe.rb