本文整理汇总了Golang中github.com/att/gopkgs/connman.Cmgr类的典型用法代码示例。如果您正苦于以下问题:Golang Cmgr类的具体用法?Golang Cmgr怎么用?Golang Cmgr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cmgr类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: send2lra
/*
Send the message to the designated 'long running' agent (lra); the
agent that has been designated to handle all long running tasks
that are not time sensitive (such as intermediate queue setup/checking).
*/
func (ad *agent_data) send2lra(smgr *connman.Cmgr, msg string) {
l := len(ad.agents)
if l <= 0 {
return
}
smgr.Write(ad.agent_list[0].id, []byte(msg))
}
开发者ID:prydeep,项目名称:tegu,代码行数:13,代码来源:agent.go
示例2: sendbytes2lra
/*
Send the message to the designated 'long running' agent (lra); the
agent that has been designated to handle all long running tasks
that are not time sensitive (such as intermediate queue setup/checking).
*/
func (ad *agent_data) sendbytes2lra(smgr *connman.Cmgr, msg []byte) {
l := len(ad.agents)
if l <= 0 {
return
}
smgr.Write(ad.agent_list[0].id, msg)
}
开发者ID:prydeep,项目名称:tegu,代码行数:13,代码来源:agent.go
示例3: sendbytes2one
/*
Send the message to one agent. The agent is selected using the current
index in the agent_data so that it effectively does a round robin.
*/
func (ad *agent_data) sendbytes2one(smgr *connman.Cmgr, msg []byte) {
l := len(ad.agents)
if l <= 0 {
return
}
smgr.Write(ad.agent_list[ad.aidx].id, msg)
ad.aidx++
if ad.aidx >= l {
if l > 1 {
ad.aidx = 1 // skip the long running agent if more than one agent connected
} else {
ad.aidx = 0
}
}
}
开发者ID:prydeep,项目名称:tegu,代码行数:20,代码来源:agent.go
示例4: connect2tegu
/*
Establishes a connection with tegu. This blocks until a connection is established
and tries every few seconds until successful.
*/
func connect2tegu(smgr *connman.Cmgr, host_port *string, data_chan chan *connman.Sess_data) {
burble := 0 // limit our complaining to once a minute or so
for {
err := smgr.Connect(*host_port, "c0", data_chan)
if err == nil {
sheep.Baa(1, "connection with tegu established: %s", *host_port)
return
}
if burble <= 0 {
sheep.Baa(0, "unable to establish a connection with tegu: %s: %s", *host_port, err)
burble = 12
}
time.Sleep(5 * time.Duration(time.Second))
burble--
}
}
开发者ID:robert-eby,项目名称:tegu,代码行数:24,代码来源:tegu_agent.go
示例5: send2all
/*
Send the message to all agents.
*/
func (ad *agent_data) send2all(smgr *connman.Cmgr, msg string) {
am_sheep.Baa(2, "sending %d bytes", len(msg))
for id := range ad.agents {
smgr.Write(id, []byte(msg))
}
}
开发者ID:prydeep,项目名称:tegu,代码行数:9,代码来源:agent.go
注:本文中的github.com/att/gopkgs/connman.Cmgr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论