dwyl / atm

🏧 free cash™
GNU General Public License v2.0
12 stars 0 forks source link

A Synchronous Task Runner ? #5

Closed nelsonic closed 7 years ago

nelsonic commented 9 years ago

One of the difficult/interesting/fun parts of this quest is how to run a series of tasks across "pages".

The easiest way is to have a boot script that reads the list of steps (e.g: from LocalStorage) and figures out which step still needs to be done. We then load the outstanding steps into a task runner.

Why does the task runner need to be _Sync_hronous?

We need the tasks to be performed in a specific _sequential_ order the way a person would interact with an application.

This is one of the few cases where using an async library is justifiable. We would use async.waterfall because an error in any step terminates execution (no point going any further) whereas async.series would attempt to keep going...

@Elan has kindly split out async.waterfall into a single file: https://github.com/es128/async-waterfall sadly, he forgot to write tests... so... we can either write our own (can we simplify it?) with _tests_ (quicker!) or Fork & PR (less fragmentation in the ecosystem).

waterfall

nelsonic commented 9 years ago

I offered to write _retrospective tests_ for: https://github.com/es128/async-waterfall/issues/6 but Elan closed my issue... don't know if that's just his way of saying "get on with it"... or if he not having tests is _not an issue_...?
either way, I think I prefer to re-write it using _much simpler code_!

iteles commented 9 years ago

@nelsonic Looks to me like just a different way with handling issues - he just prefers to not have a question open if he's already answered it pending a PR

nelsonic commented 7 years ago

closing. no longer relevant. ✅