func()

in ecr/stream/chunked_processor.go [135:160]


func (processor *chunkedProcessor) processChunks(readCallback readCallbackFunc) (int64, error) {
	defer processor.cancel()

	lastReadByte := int64(0)
	eof := false

	for !eof {
		select {
		case chunk := <-processor.readChannel:
			if chunk == nil {
				eof = true
				break
			}
			lastReadByte = chunk.BytesEnd
			err := readCallback(chunk)

			if err != nil {
				return 0, err
			}
		case err := <-processor.errorChannel:
			return 0, err
		}
	}

	return lastReadByte, nil
}