github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/worker/uniter/relation/hookqueue.go (about)

     1  // Copyright 2012-2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package relation
     5  
     6  import (
     7  	"github.com/juju/juju/worker/uniter/hook"
     8  )
     9  
    10  // HookQueue exists to keep the package interface stable.
    11  type HookQueue interface {
    12  	HookSender
    13  }
    14  
    15  // NewAliveHookQueue exists to keep the package interface stable; it wraps the
    16  // result of NewLiveHookSource in a HookSender.
    17  func NewAliveHookQueue(initial *State, out chan<- hook.Info, w RelationUnitsWatcher) HookQueue {
    18  	source := NewLiveHookSource(initial, w)
    19  	return NewHookSender(out, source)
    20  }
    21  
    22  // NewDyingHookQueue exists to keep the package interface stable; it wraps the
    23  // result of NewDyingHookSource in a HookSender.
    24  func NewDyingHookQueue(initial *State, out chan<- hook.Info) HookQueue {
    25  	source := NewDyingHookSource(initial)
    26  	return NewHookSender(out, source)
    27  }