[Seaside] Showing progress

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Fri Mar 3 04:33:12 UTC 2017


Jupiter.

not a perfect answer, but what I'd try is forking the actual processing 
as a background process on the server and add two inst vars to the 
component:

* processingDone
* currentProgressMessage

which would be updated by the background process as it progresses 
through its job.

The first ajax call would be finished right after forking the background 
process, so teh browser would get an instant answer. All you need to do 
then is set up a timeOut() and have the browser ask for the current 
progress by issueing ajax calls every, say, 750-1000msec, until the 
server responds with "processingDone=true".

The problem is, I have written something like this in Javascript, where 
I registered a callback for the progress message in renderContentOn: , 
but have no idea how to do it in Seaside's javascript rendering methods.

I hope this idea helps you get a step further.

Joachim




Am 03.03.17 um 03:54 schrieb Jupiter Jones:
> Hi all,
>
> I have a relatively short process (about 5 to 10 seconds) that I would like to show the progress of.
>
> It’s triggered by ajax:
>
> html button
>              bePush;
>              onClick:
>                  (html jQuery ajax script: [ :s | self fetchShowingProgressOnScript: s ]);
>
> fetchShowingProgressOnScript: s
>
>    s << (s jQuery id: ‘progress')
>      html: [ :r | r paragraph: 'Connecting to Downer...' ].
>    integration connect.
>    s << (s jQuery id: ‘progress')
>      html: [ :r | r paragraph: 'Logging In...' ].
>    integration login.
>    s << (s jQuery id: ‘progress')
>      html: [ :r | r paragraph: 'Looking up ' , self idToFetch ].
>    integration find: self idToFetch..
>    s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Done.' ].
>    integration quit
>
> However this won’t work because the script will not be returned to the browser until the method completes.
>
> What’s the recommended way of going about this? Can you push a partial result without a streaming server?
>
> Is there a way of doing this without some kind of polling loop and running the long operation in a separate thread?
>
> Cheers,
>
> Jupiter
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1



More information about the seaside mailing list