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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinvokeLater(Runnable action) Invokesactionon the nextPlatform.framesignal or, if the game is paused, on the OS UI thread.voidinvokeNextFrame(Runnable action) Invokesactionon the nextPlatform.framesignal.Methods inherited from class playn.core.Exec
deferredPromise, invokeAsync, isAsyncSupported, isMainThread
-
Constructor Details
-
Default
-
-
Method Details
-
invokeNextFrame
Description copied from class:ExecInvokesactionon the nextPlatform.framesignal. 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:
invokeNextFramein classExec
-
invokeLater
Description copied from class:ExecInvokesactionon the nextPlatform.framesignal 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 useinvokeLaterto 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:
invokeLaterin classExec
-