Skip to content

Commit

Permalink
add GtLiveSlide>>#futureConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Nov 6, 2024
1 parent 472db02 commit 78e155e
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/GToolkit-Presenter/GtLiveSlide.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Class {
'cachedElement',
'slideIndex',
'slideShow',
'isSlideSelected'
'isSlideSelected',
'futureConfiguration'
],
#category : #'GToolkit-Presenter'
}
Expand Down Expand Up @@ -83,6 +84,23 @@ GtLiveSlide >> cachedElement: anObject [
cachedElement := anObject
]

{ #category : #initialization }
GtLiveSlide >> defaultFutureConfiguration [
^ AsyncFutureExecutionConfiguration new customGroup: #Slide
]

{ #category : #accessing }
GtLiveSlide >> futureConfiguration [
<return: #AsyncFutureExecutionConfiguration>
^ futureConfiguration ifNil: [
futureConfiguration := self defaultFutureConfiguration ]
]

{ #category : #accessing }
GtLiveSlide >> futureConfiguration: aAsyncFutureExecutionConfiguration [
futureConfiguration := aAsyncFutureExecutionConfiguration
]

{ #category : #accessing }
GtLiveSlide >> generateElements [
"Generate the receiver's element and preview"
Expand Down Expand Up @@ -240,24 +258,25 @@ 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: [
BlFrameTelemetry
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 }
Expand Down

0 comments on commit 78e155e

Please sign in to comment.