func (taskEvents *taskSendableEvents) sendChange(change *sendableEvent,
	client api.ECSClient,
	handler *TaskHandler) {

	taskEvents.lock.Lock()
	defer taskEvents.lock.Unlock()

	// Add event to the queue
	seelog.Infof("TaskHandler: Adding event: %s", change.toString())
	taskEvents.events.PushBack(change)

	if !taskEvents.sending {
		// If a send event is not already in progress, trigger the
		// submitTaskEvents to start sending changes to ECS
		taskEvents.sending = true
		go handler.submitTaskEvents(taskEvents, client, change.taskArn())
	} else {
		seelog.Debugf(
			"TaskHandler: Not submitting change as the task is already being sent: %s",
			change.toString())
	}
}
func (taskEvents *taskSendableEvents) sendChange(change *sendableEvent,
	client api.ECSClient,
	handler *TaskHandler) {

	taskEvents.lock.Lock()
	defer taskEvents.lock.Unlock()

	
	seelog.Infof("TaskHandler: Adding event: %s", change.toString())
	taskEvents.events.PushBack(change)

	if !taskEvents.sending {
		
		
		taskEvents.sending = true
		go handler.submitTaskEvents(taskEvents, client, change.taskArn())
	} else {
		seelog.Debugf(
			"TaskHandler: Not submitting change as the task is already being sent: %s",
			change.toString())
	}
}
func ( taskEvents * taskSendableEvents ) sendChange ( change * sendableEvent , client api . ECSClient , handler * TaskHandler ) { taskEvents . lock . Lock ( ) defer taskEvents . lock . Unlock ( ) // Add event to the queue seelog . Infof ( " " , change . toString ( ) ) taskEvents . events . PushBack ( change ) if ! taskEvents . sending { // If a send event is not already in progress, trigger the // submitTaskEvents to start sending changes to ECS taskEvents . sending = true go handler . submitTaskEvents ( taskEvents , client , change . taskArn ( ) ) } else { seelog . Debugf ( " " , change . toString ( ) ) } }
// sendChange adds the change to the sendable events queue. It triggers
// the handler's submitTaskEvents async method to submit this change if
// there's no go routines already sending changes for this event list
sendChange adds the change to the sendable events queue . It triggers the handler s submitTaskEvents async method to submit this change if there s no go routines already sending changes for this event list