// new request
Request request = buildRequest(target, targetListener, options, callbackExecutor);
Request previous = target.getRequest();
if (request.isEquivalentTo(previous)
&& !isSkipMemoryCacheWithCompletePreviousRequest(options, previous)) {
// If the request is completed, beginning again will ensure the result is re-delivered,
// triggering RequestListeners and Targets. If the request is failed, beginning again will
// restart the request, giving it another chance to complete. If the request is already
// running, we can let it continue running without interruption.
if (!Preconditions.checkNotNull(previous).isRunning()) {
// Use the previous request rather than the new one to allow for optimizations like skipping
// setting placeholders, tracking and un-tracking Targets, and obtaining View dimensions
// that are done in the individual Request.
previous.begin();
}
return target;
如果是同一个请求,并且没有跳过之前请求完成的内存缓存,则不创建新的请求,如果原来的请求不在运行中,则让它开始运行;如果原来的请求在运行中,则让它正常进行,并把结果通知Target对象。
如果不是同一个请求,则把之前的请求clear掉,把新的请求添加到请求管理队列,进行追踪请求。