kohana / minion

Everyone loves having a minion they can boss around
113 stars 76 forks source link

added progress bar CLI method #70

Closed ivank closed 7 years ago

ivank commented 11 years ago

A method to Iterate through array of items one by one, executing a callback function, and displaing a progress bar that fills up as it progresses through the array. Show also percentage, elapesed time and ETA.

Any Kohana_Exceptions will be catched and displayed at the end of the progress. While its running it also displays how many exceptions have occurred.

The callback function recieves the current item, index and items count as arguments

zeelot commented 11 years ago

That's an interesting method, but probably a bit too specific for inclusion in the module. You could make a feature request on redmine if you want to see what people think.

That being said, the Minion_CLI class should be about interacting with the command line, not about running callbacks, so this logic would belong in a different class.

ivank commented 11 years ago

Well generally speaking minion tasks (at least in my experience) end up being stuff that you don't want to implement in your controllers and that tends to be heavy lifting - updating indexes, generating files and stuff - and I was sick and tired of watching the 1000+ lines output of a script that just updated a bunch of files, constantly checking "is it finished yet, are there any errors ... ". So I came up with this. I agree that Minion_CLI is way too overcrowded at the moment for this, and there should be a more appropriate place, but I think kohana framework should definitely have something like this as I find using it daily and I've missed it dearly in the past.

On the other hand a function with just one callback seems like the most natural fit for this kind of problem, so I didn't think a whole new class would be justified just for this method. What else can we put in a helper class like this?

On Nov 29, 2012, at 8:32 PM, Lorenzo Pisani notifications@github.com wrote:

That's an interesting method, but probably a bit too specific for inclusion in the module. You could make a feature request on redmine if you want to see what people think.

That being said, the Minion_CLI class should be about interacting with the command line, not about running callbacks, so this logic would belong in a different class.

— Reply to this email directly or view it on GitHub.