Progress Bar Widget

Hi,

I have a custom dx content type with its own workflow in 4.3.x. On one of the transitions, an event handler generates a lengthy report which can take several minutes. I suggested the report be generated with async and emailed to the user but the client would like to see some sort of progress bar. I looked a collective.progressbar but it needs the request. Any pointers where this has been done before?

Mike

If you decide to roll your own, you likely need:

(1) Some async mechanism; if you can, I recommend an out-of-band worker process that connects to your ZODB. If you have a process control system like supervisord, this is reasonable and less fuss than plone.app.async for building something new. You could also consider something like collective.celery.

(2) To store progress/state (e.g. est. percent) outside ZODB, meaning some (in likelihood) some kind of message queue. Celery might not be enough here, should you use it, because it does not have a place to keep (continuous/percent) task state (just finite state).

If you are exclusively *nix hosted, using a host-local (IPC) message queue might be reasonable to store percent-done, assuming you poll it from a browser view, which is in turn polled by JS on a setTimeout() function via ajax. If you use both Mac/Linux, you could use https://pypi.python.org/pypi/sysv_ipc for broadest compatibility as your message queue (storing formatted percentage values as strings).

Sean

Thanks for your response, Sean. I thought about rolling my own but after
some minor changes on my side, I got collective.progressbar to work on
localhost. The bummer is I can't get it to run through nginx. When on
localhost, looking at Network in chrome inspector, it loads http://localhost:8080/Plone/@@collective.progressbar-demo
immediately with status 200 and advances the timeline as the demo
progresses. But via nginx is shows status pending until the demo ends
and only then renders the last demo page with status 200. I added the
following to nginx but has no affect:

add_header 'Access-Control-Allow-Origin' '*';
add_header 'X-Frame-Options' '';
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'";

Any ideas on how to debug this?

Update: I tested it on Apache and it works so clearly my nginx config is wrong - here are my nginx configs