本文整理汇总了Golang中github.com/juju/juju/worker/dependency.Manifold.Output方法的典型用法代码示例。如果您正苦于以下问题:Golang Manifold.Output方法的具体用法?Golang Manifold.Output怎么用?Golang Manifold.Output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/juju/worker/dependency.Manifold
的用法示例。
在下文中一共展示了Manifold.Output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: waiter
func waiter(c *gc.C, m dependency.Manifold, w worker.Worker) gate.Waiter {
var waiter gate.Waiter
err := m.Output(w, &waiter)
c.Assert(err, jc.ErrorIsNil)
c.Assert(waiter, gc.NotNil)
return waiter
}
示例2: unlocker
func unlocker(c *gc.C, m dependency.Manifold, w worker.Worker) gate.Unlocker {
var unlocker gate.Unlocker
err := m.Output(w, &unlocker)
c.Assert(err, jc.ErrorIsNil)
c.Assert(unlocker, gc.NotNil)
return unlocker
}
示例3: assertGate
func assertGate(c *gc.C, manifold dependency.Manifold, unlocker gate.Unlocker) {
w, err := manifold.Start(nil)
c.Assert(err, jc.ErrorIsNil)
defer worker.Stop(w)
var waiter gate.Waiter
err = manifold.Output(w, &waiter)
c.Assert(err, jc.ErrorIsNil)
select {
case <-waiter.Unlocked():
c.Fatalf("expected gate to be locked")
default:
}
unlocker.Unlock()
select {
case <-waiter.Unlocked():
default:
c.Fatalf("expected gate to be unlocked")
}
}