uis icon indicating copy to clipboard operation
uis copied to clipboard

Async load of items

Open xabio opened this issue 3 years ago • 5 comments

It would be awesome if it could load items in a async way.

xabio avatar May 16 '21 07:05 xabio

Hm.. but you can implement you own async load in OnFill method.

mopsicus avatar May 16 '21 22:05 mopsicus

It would be awesome if it could load items in a async way.

use Corountine make load data asynchronously pretty easy~

class Foo
{
Coroutine task;
public void OnFilled()
{
if(null!=task)StopCoroutine(task);
task = StartCoroutine();
}
IEnumerator SomeTask()
{
  async operation here
}
}


Bian-Sh avatar Apr 26 '22 05:04 Bian-Sh

It would be awesome if it could load items in a async way.

use Corountine make load data asynchronously pretty easy~

class Foo
{
Coroutine task;
public void OnFilled()
{
if(null!=task)StopCoroutine(task);
task = StartCoroutine();
}
IEnumerator SomeTask()
{
  async operation here
}
}

Coroutine != async

mopsicus avatar Apr 26 '22 05:04 mopsicus

but in unity Coroutine = asynchronous operation ≈ async

it is easy to start onfilled and stop onrecycle。 if use Task,webgl not support yet and a little heavy and a bit more hard to cancel then coroutine as unitask support webgl but still need some logic to cancel it when cell recycle. so i sugguest coroutine

Bian-Sh avatar Apr 27 '22 04:04 Bian-Sh

but in unity Coroutine = asynchronous operation ≈ async

it is easy to start onfilled and stop onrecycle。 if use Task,webgl not support yet and a little heavy and a bit more hard to cancel then coroutine as unitask support webgl but still need some logic to cancel it when cell recycle. so i sugguest coroutine

In Unity coroutines works in main thread! It's not async. Task and Coroutine are two different things.

mopsicus avatar May 13 '22 14:05 mopsicus