Refactoring Slow Forms Using PHP Generators and Event Streams


Originally published at:

The form will still be slow but the user experience will be better. The user will see a progress bar and see status updates in real time. The idea is to refactor something like this: /** * A task that takes way too loooooooooooooooooooooooong… */ function task() { step1(); step2(); step3(); // step100(); } Into…


This is awesome…May be similar progress bar might require while importing books. The site looks like frozen while importing huge content of books, but when you refresh, the next step of import option appears.