Package playn.core
Class Exec.Default
java.lang.Object
playn.core.Exec
playn.core.Exec.Default
- Enclosing class:
Exec
A default exec implementation which processes
invokeLater(java.lang.Runnable)
via the frame tick.-
Nested Class Summary
Nested classes/interfaces inherited from class playn.core.Exec
Exec.Default
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
invokeLater
(Runnable action) Invokesaction
on the nextPlatform.frame
signal or, if the game is paused, on the OS UI thread.void
invokeNextFrame
(Runnable action) Invokesaction
on the nextPlatform.frame
signal.Methods inherited from class playn.core.Exec
deferredPromise, invokeAsync, isAsyncSupported, isMainThread
-
Constructor Details
-
Default
-
-
Method Details
-
invokeNextFrame
Description copied from class:Exec
Invokesaction
on the nextPlatform.frame
signal. The default implementation listens to the frame signal at a very high priority so that invoke later actions will run before the game's normal callbacks. Note: if the game is paused, these actions will not run until it is unpaused and the next game frame is processed.- Specified by:
invokeNextFrame
in classExec
-
invokeLater
Description copied from class:Exec
Invokesaction
on the nextPlatform.frame
signal or, if the game is paused, on the OS UI thread. Actions posted here will still be run in order and in a single threaded manner (likeExec.invokeNextFrame(java.lang.Runnable)
), but they are not guaranteed to run on the game thread if the game is paused during the frame on which actions are posted.If you're deferring a graphics or (game) UI action, you should almost certainly use
Exec.invokeNextFrame(java.lang.Runnable)
, but if you are deferring an action like saving data or initiating a network connection, you may wish to useinvokeLater
to ensure that those actions are completed even if the player happens to pause the game (by backgrounding the app on mobile, for example) immediately after they are queued up.- Specified by:
invokeLater
in classExec
-