square / cycler

Apache License 2.0
791 stars 27 forks source link

Add UpdateMode for specifying synchronous or asynchronous behavior when populating and updating lists #62

Closed ijwhelan closed 1 year ago

ijwhelan commented 1 year ago
ijwhelan commented 1 year ago

@helios175 Just pushed some changes, I ended up leaving out the Pair.toSync() for now in favor of some changes to UpdateWork to make it clearer that diffing work (a.k.a asyncWork) isn't always async. Now UpdateWork has work and notifications. If UpdateWork.isSynchronous is true, we execute work and notifications synchronously, otherwise we go into the coroutines logic.

I think this ends up being a little simpler and more concise than taking the Pair.toSync() route.