本文整理匯總了Golang中github.com/pubnub/go/messaging.Pubnub.ChannelGroupAddChannel方法的典型用法代碼示例。如果您正苦於以下問題:Golang Pubnub.ChannelGroupAddChannel方法的具體用法?Golang Pubnub.ChannelGroupAddChannel怎麽用?Golang Pubnub.ChannelGroupAddChannel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/pubnub/go/messaging.Pubnub
的用法示例。
在下文中一共展示了Pubnub.ChannelGroupAddChannel方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: populateGroup
func populateGroup(pubnub *messaging.Pubnub, group, channels string) {
successChannel := make(chan []byte)
errorChannel := make(chan []byte)
pubnub.ChannelGroupAddChannel(group, channels, successChannel, errorChannel)
select {
case <-successChannel:
case <-errorChannel:
}
}
示例2: populateChannelGroup
func populateChannelGroup(pubnub *messaging.Pubnub, group, channels string) {
successChannel := make(chan []byte, 1)
errorChannel := make(chan []byte, 1)
pubnub.ChannelGroupAddChannel(group, channels, successChannel, errorChannel)
select {
case <-successChannel:
// fmt.Println("Group created")
case <-errorChannel:
fmt.Println("Channel group creation error")
case <-timeout():
fmt.Println("Channel group creation timeout")
}
}
示例3: createChannelGroups
func createChannelGroups(pubnub *messaging.Pubnub, groups []string) {
successChannel := make(chan []byte, 1)
errorChannel := make(chan []byte, 1)
for _, group := range groups {
// fmt.Println("Creating group", group)
pubnub.ChannelGroupAddChannel(group, "adsf", successChannel, errorChannel)
select {
case <-successChannel:
// fmt.Println("Group created")
case <-errorChannel:
fmt.Println("Channel group creation error")
case <-timeout():
fmt.Println("Channel group creation timeout")
}
}
}