Pre Merge pull request !413 from Madi/3.x
This commit is contained in:
commit
add4d53b84
|
@ -3,6 +3,8 @@
|
||||||
- The sub-thread network request is changed to asynchronous, thereby increasing the number of concurrent sub-thread network requests
|
- The sub-thread network request is changed to asynchronous, thereby increasing the number of concurrent sub-thread network requests
|
||||||
- Set the concurrency through the setMaxRequests interface under the ImageKnife class
|
- Set the concurrency through the setMaxRequests interface under the ImageKnife class
|
||||||
- aboutToRecycle life cycle clear image content
|
- aboutToRecycle life cycle clear image content
|
||||||
|
- Fixed bug for receive only the first onLoadStart for concurrent identical requests
|
||||||
|
- Modify the condition for determining whether to queue to be greater than or equal to maxRequests
|
||||||
|
|
||||||
## 3.0.3
|
## 3.0.3
|
||||||
- Released version 3.0.3
|
- Released version 3.0.3
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class ImageKnifeDispatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//3.判断是否要排队
|
//3.判断是否要排队
|
||||||
if (this.executingJobMap.length > this.maxRequests) {
|
if (this.executingJobMap.length >= this.maxRequests) {
|
||||||
this.jobQueue.add(request)
|
this.jobQueue.add(request)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,11 @@ export class ImageKnifeDispatcher {
|
||||||
*/
|
*/
|
||||||
getAndShowImage(currentRequest: ImageKnifeRequest, imageSrc: string | PixelMap | Resource, requestSource: ImageKnifeRequestSource,isAnimator?: boolean): void {
|
getAndShowImage(currentRequest: ImageKnifeRequest, imageSrc: string | PixelMap | Resource, requestSource: ImageKnifeRequestSource,isAnimator?: boolean): void {
|
||||||
LogUtil.log("ImageKnife_DataTime_getAndShowImage.start:" + currentRequest.imageKnifeOption.loadSrc)
|
LogUtil.log("ImageKnife_DataTime_getAndShowImage.start:" + currentRequest.imageKnifeOption.loadSrc)
|
||||||
|
if (requestSource === ImageKnifeRequestSource.SRC && currentRequest.imageKnifeOption.onLoadListener?.onLoadStart !== undefined) {
|
||||||
|
currentRequest.imageKnifeOption.onLoadListener?.onLoadStart()
|
||||||
|
LogUtil.log("ImageKnife_DataTime_getAndShowImage_onLoadStart:" + currentRequest.imageKnifeOption.loadSrc)
|
||||||
|
}
|
||||||
|
|
||||||
let memoryKey: string = this.engineKey.generateMemoryKey(imageSrc, requestSource, currentRequest.imageKnifeOption,isAnimator)
|
let memoryKey: string = this.engineKey.generateMemoryKey(imageSrc, requestSource, currentRequest.imageKnifeOption,isAnimator)
|
||||||
let requestList: List<ImageKnifeRequestWithSource> | undefined = this.executingJobMap.get(memoryKey)
|
let requestList: List<ImageKnifeRequestWithSource> | undefined = this.executingJobMap.get(memoryKey)
|
||||||
if (requestList == undefined) {
|
if (requestList == undefined) {
|
||||||
|
@ -140,6 +145,9 @@ export class ImageKnifeDispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
let isWatchProgress : boolean = false
|
let isWatchProgress : boolean = false
|
||||||
|
if (currentRequest.imageKnifeOption.progressListener !== undefined && requestSource === ImageKnifeRequestSource.SRC) {
|
||||||
|
isWatchProgress = true
|
||||||
|
}
|
||||||
|
|
||||||
// 回调请求开始
|
// 回调请求开始
|
||||||
requestList.forEach((requestWithSource: ImageKnifeRequestWithSource) => {
|
requestList.forEach((requestWithSource: ImageKnifeRequestWithSource) => {
|
||||||
|
|
Loading…
Reference in New Issue