Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to load assets in parallel #2

Open
art0rz opened this issue May 21, 2018 · 3 comments
Open

Add ability to load assets in parallel #2

art0rz opened this issue May 21, 2018 · 3 comments

Comments

@art0rz
Copy link

art0rz commented May 21, 2018

No description provided.

@larsvanbraam
Copy link
Collaborator

@art0rz

You can change the batch size to load multiple assets at the same task in the same task.

const task = new LoadImageTask({
  assets: [
    'path/to/image-1.jpg', 
    'path/to/image-2.jpg',
    'path/to/image-3.jpg',
    'path/to/image-4.jpg',
    'path/to/image-5.jpg',
  ],
  // The size of a batch, this is how many requests happen at the same time
  batchSize: 5,
})

task.load();

Or do you mean you would like to be able to load different tasks simultaneously?

@art0rz
Copy link
Author

art0rz commented May 22, 2018

@larsvanbraam yeah. for example I have a large video and a bunch of images, it doesn't start loading images until the video is done. It would be great to have a global parallel setting which allows multiple different tasks simultaneously.

@art0rz
Copy link
Author

art0rz commented May 22, 2018

@larsvanbraam also, instead of a batch option, a parallel option would be good, too. The batch option loads N items and waits until they are all done before the next batch starts. A parallel option would always be loading N items simultaneously, starting a new load as soon as one is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants