// Lifecycle return jobsync.Lifecycle object connected to scope. If Lifecycle object doesn't exist, create new one and return it.
436434
func Lifecycle(scope app.Scope) *jobsync.Lifecycle {
	var (
		lifecycleIns interface{}
		lifecycle    *jobsync.Lifecycle
		err          error
	)
	lifecycleIns, err = scope.Get(insKey)
	if err != nil || lifecycleIns == nil {
		lifecycle = jobsync.NewLifecycle(workers.DefaultTimeout, true)
		scope.Set(insKey, lifecycle)
	} else {
		lifecycle = lifecycleIns.(*jobsync.Lifecycle)
	}
	return lifecycle
}
1333408
func (s *ECSTarget) SetLifecycleEvents(v []*LifecycleEvent) *ECSTarget {
	s.LifecycleEvents = v
	return s
}
610158
func (lbc *loadBalancerController) worker() {
	for {
		key, _ := lbc.queue.Get()
		glog.Infof("Sync triggered by service %v", key)
		if err := lbc.sync(false); err != nil {
			glog.Warningf("Requeuing %v because of error: %v", key, err)
			lbc.queue.Add(key)
		}
		lbc.queue.Done(key)
	}
}
815483
func (s *InstanceDetails) SetLifecycleState(v string) *InstanceDetails {
	s.LifecycleState = &v
	return s
}
576501
func (ctrl *PersistentVolumeController) enqueueWork(queue workqueue.Interface, obj interface{}) {
	// Beware of "xxx deleted" events
	if unknown, ok := obj.(cache.DeletedFinalStateUnknown); ok && unknown.Obj != nil {
		obj = unknown.Obj
	}
	objName, err := controller.KeyFunc(obj)
	if err != nil {
		klog.Errorf("failed to get key from object: %v", err)
		return
	}
	klog.V(5).Infof("enqueued %q for sync", objName)
	queue.Add(objName)
}
662428
func (s *GetLifecyclePolicyOutput) SetLifecyclePolicy(v string) *GetLifecyclePolicyOutput {
	s.LifecyclePolicy = &v
	return s
}
1156359
func NewRecycle(newItem func() interface{}, returnQueueSize int,
	gcInterval, expiryInterval time.Duration) *Recycle {

	return &Recycle{
		queue: queue.NewGCQueue(
			newItem, returnQueueSize,
			gcInterval, expiryInterval,
		),
	}
}
655082
func (l *DefaultLifecycle) addTask(t *Task) {
	l.rmu.Lock()
	defer l.rmu.Unlock()

	l.registry = append([]*Task{t}, l.registry...)
	l.wg.Add(1)
}
707161
func (s *DescribeRecoveryPointOutput) SetCalculatedLifecycle(v *CalculatedLifecycle) *DescribeRecoveryPointOutput {
	s.CalculatedLifecycle = v
	return s
}
905089
func (c Client) getBucketLifecycle(bucketName string) (string, error) {
	// Get resources properly escaped and lined up before
	// using them in http request.
	urlValues := make(url.Values)
	urlValues.Set("lifecycle", "")

	// Execute GET on bucket to get lifecycle.
	resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{
		bucketName:  bucketName,
		queryValues: urlValues,
	})

	defer closeResponse(resp)
	if err != nil {
		return "", err
	}

	if resp != nil {
		if resp.StatusCode != http.StatusOK {
			return "", httpRespToErrorResponse(resp, bucketName, "")
		}
	}

	bucketLifecycleBuf, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return "", err
	}

	lifecycle := string(bucketLifecycleBuf)
	return lifecycle, err
}
76205
func (s *Instance) SetLifecycleState(v string) *Instance {
	s.LifecycleState = &v
	return s
}
643736
func (s *LambdaTarget) SetLifecycleEvents(v []*LifecycleEvent) *LambdaTarget {
	s.LifecycleEvents = v
	return s
}
504381
func (r *ResourceLifecycle) Copy() *ResourceLifecycle {
	n := &ResourceLifecycle{
		CreateBeforeDestroy: r.CreateBeforeDestroy,
		PreventDestroy:      r.PreventDestroy,
		IgnoreChanges:       make([]string, len(r.IgnoreChanges)),
	}
	copy(n.IgnoreChanges, r.IgnoreChanges)
	return n
}
1226499
func (s *StartBackupJobInput) SetLifecycle(v *Lifecycle) *StartBackupJobInput {
	s.Lifecycle = v
	return s
}
517416
func networkEventLifecycleCallback(c C.virConnectPtr, n C.virNetworkPtr,
	event int, detail int,
	goCallbackId int) {

	network := &Network{ptr: n}
	connection := &Connect{ptr: c}

	eventDetails := &NetworkEventLifecycle{
		Event:  NetworkEventLifecycleType(event),
		Detail: detail,
	}

	callbackFunc := getCallbackId(goCallbackId)
	callback, ok := callbackFunc.(NetworkEventLifecycleCallback)
	if !ok {
		panic("Inappropriate callback type called")
	}
	callback(connection, network, eventDetails)
}
974417
func domainEventLifecycleCallback(c C.virConnectPtr, d C.virDomainPtr,
	event int, detail int,
	goCallbackId int) {

	domain := &Domain{ptr: d}
	connection := &Connect{ptr: c}

	eventDetails := &DomainEventLifecycle{
		Event:  DomainEventType(event),
		Detail: detail,
	}

	callbackFunc := getCallbackId(goCallbackId)
	callback, ok := callbackFunc.(DomainEventLifecycleCallback)
	if !ok {
		panic("Inappropriate callback type called")
	}
	callback(connection, domain, eventDetails)
}
918569
func (s *DeleteFileSystemOutput) SetLifecycle(v string) *DeleteFileSystemOutput {
	s.Lifecycle = &v
	return s
}