From 78e155e052d8c7dc219be6ddfba29667a1b9b912 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 6 Nov 2024 15:09:48 -0300 Subject: [PATCH] add `GtLiveSlide>>#futureConfiguration` --- src/GToolkit-Presenter/GtLiveSlide.class.st | 29 +++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/GToolkit-Presenter/GtLiveSlide.class.st b/src/GToolkit-Presenter/GtLiveSlide.class.st index e1db1bec..3a4d6bc5 100644 --- a/src/GToolkit-Presenter/GtLiveSlide.class.st +++ b/src/GToolkit-Presenter/GtLiveSlide.class.st @@ -13,7 +13,8 @@ Class { 'cachedElement', 'slideIndex', 'slideShow', - 'isSlideSelected' + 'isSlideSelected', + 'futureConfiguration' ], #category : #'GToolkit-Presenter' } @@ -83,6 +84,23 @@ GtLiveSlide >> cachedElement: anObject [ cachedElement := anObject ] +{ #category : #initialization } +GtLiveSlide >> defaultFutureConfiguration [ + ^ AsyncFutureExecutionConfiguration new customGroup: #Slide +] + +{ #category : #accessing } +GtLiveSlide >> futureConfiguration [ + + ^ futureConfiguration ifNil: [ + futureConfiguration := self defaultFutureConfiguration ] +] + +{ #category : #accessing } +GtLiveSlide >> futureConfiguration: aAsyncFutureExecutionConfiguration [ + futureConfiguration := aAsyncFutureExecutionConfiguration +] + { #category : #accessing } GtLiveSlide >> generateElements [ "Generate the receiver's element and preview" @@ -240,10 +258,10 @@ GtLiveSlide >> queueAsyncUpdate: aSpace [ "Submit a task to cache the receiver's elements" - | aCommand | + | aSliceCommand | cachedElement needsUpdate ifFalse: [ ^ self ]. - aCommand := GtSlideCommand new slide: self. + aSliceCommand := GtSlideCommand new slide: self. BlUseAsyncFeatures ifEnabledDo: [ @@ -251,13 +269,14 @@ GtLiveSlide >> queueAsyncUpdate: aSpace [ time: [ 'Schedule slide {1} update command in UI pool' format: { self class name } ] - during: [ [ aCommand execute ] asAsyncFuture await ] ] + during: [ [ aSliceCommand execute ] asAsyncFuture + await: self futureConfiguration ] ] otherwise: [ BlFrameTelemetry time: [ 'Execute slide {1} update command directly' format: { self class name } ] - during: [ aCommand execute ] ] + during: [ aSliceCommand execute ] ] ] { #category : #accessing }