Suggestion: Asset Dequeue for per frame loading

An Asset Dequeue that you can add assets to that and then call AssetDequeue.update during the application update loop.

This removes most of the hang from resource loading and removes the need for threads since assets are loaded every frame.

AssetDequeue assets = new AssetDequeue(int maxSize); //once max queue size is hit then it throttles the assets loaded per frame.

assets.registerAssetLoadedCallback(new AssetLoadedCallback(){

public void loaded(AssetKey assetkey){ }


simpleUpdate(float tpf){

if (assets.hasMore()){

assets.load(); // loads next asset and calls the registered AssetLoadedCallback, also throttles loading if necessary


super.update(tpf); // update the core


Assets really should be loaded on a background thread, though. And if you want to load them on the update thread then it’s not hard.


…something like…

class Loader implements Runnable {

Application app;

AssetKey key;

public Loader( Application app, AssetKey key ) { = app;

this.key = key;


public void run() {

load asset and do stuff with it




ConcurrentLinkedQueue<Runnable > loaders = new ConcurrentLinkedQueue<Runnable >();

simpuleUpdate() {

Runnable r = loaders.poll();

if (r != null );



Just add whatever Runnables you want to be dequeued once per frame.

Even better they are already set if you wanted to launch them into separate threads to do the loading and then push them back onto loaders queue when they’re done. Just make run() behave differently the second time.

It’s pretty specific so I’m not sure it’s worth infrastructure and most are confused enough by the Callable mechanism already included.

Not worth it, for one its not usable for every usecase, and also it is already dooable.

Just put a queu with loading tasks in the application and in update pop from the queue and load it.