agent/eventhandler/task_handler.go
func (handler *TaskHandler) getTaskEventsUnsafe(event *sendableEvent) *taskSendableEvents {
	taskARN := event.taskArn()
	taskEvents, ok := handler.tasksToEvents[taskARN]

	if !ok {
		// We are not tracking this task arn in the tasksToEvents map. Create
		// a new entry
		taskEvents = &taskSendableEvents{
			events:    list.New(),
			sending:   false,
			createdAt: time.Now(),
			taskARN:   taskARN,
		}
		handler.tasksToEvents[taskARN] = taskEvents
		seelog.Debugf("TaskHandler: collecting events for new task; event: %s; events: %s ",
			event.toString(), taskEvents.toStringUnsafe())
	}

	return taskEvents
}
func (handler *TaskHandler) getTaskEventsUnsafe(event *sendableEvent) *taskSendableEvents {
	taskARN := event.taskArn()
	taskEvents, ok := handler.tasksToEvents[taskARN]

	if !ok {
		// We are not tracking this task arn in the tasksToEvents map. Create
		// a new entry
		taskEvents = &taskSendableEvents{
			events:    list.New(),
			sending:   false,
			createdAt: time.Now(),
			taskARN:   taskARN,
		}
		handler.tasksToEvents[taskARN] = taskEvents
		seelog.Debugf("TaskHandler: collecting events for new task; event: %s; events: %s ",
			event.toString(), taskEvents.toStringUnsafe())
	}

	return taskEvents
}
func ( handler * TaskHandler ) getTaskEventsUnsafe ( event * sendableEvent ) * taskSendableEvents { taskARN := event . taskArn ( ) taskEvents , ok := handler . tasksToEvents [ taskARN ] if ! ok { // We are not tracking this task arn in the tasksToEvents map. Create // a new entry taskEvents = & taskSendableEvents { events : list . New ( ) , sending : false , createdAt : time . Now ( ) , taskARN : taskARN , } handler . tasksToEvents [ taskARN ] = taskEvents seelog . Debugf ( " " , event . toString ( ) , taskEvents . toStringUnsafe ( ) ) } return taskEvents }
// getTaskEventsUnsafe gets the event list for the task arn in the sendableEvent
// from taskToEvent map
getTaskEventsUnsafe gets the event list for the task arn in the sendableEvent from taskToEvent map