<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi, <div class=""><br class=""></div><div class="">Last I checked, Seaside is single-threaded which is a “good thing.” That said, it implies that every user action must return quickly… perhaps no longer than 1 second. If the action takes longer, a chain reaction starts to form from multiple “simultaneous” users (not really at-the-same-time users, they queue up with the single thread). There are times, in apps I’ve written, where the act of clicking a link (or button) is expected to take 10 minutes (sometimes half hour). During this time we want to fork a thread to do the big task (like generate a report) that doesn’t tie up the main thread. This way we can poll every 2 seconds to ask “are you done yet?” with a progress bar and then ultimately bring the user back to the normal flow. </div><div class=""><br class=""></div><div class="">Does Seaside have a pre-baked solution for this? </div><div class=""><br class=""></div><div class="">If not, I’ll take Ramon’s lead as his posts are the only thing I’ve been able to find about the subject:</div><div class=""><a href="http://onsmalltalk.com/polling-for-long-running-processes" class="">http://onsmalltalk.com/polling-for-long-running-processes</a></div><div class=""><a href="http://onsmalltalk.com/2010-07-28-a-simple-thread-pool-for-smalltalk" class="">http://onsmalltalk.com/2010-07-28-a-simple-thread-pool-for-smalltalk</a></div><div class=""><br class="">
In his case, he wanted a page to load immediately but then have a handful (or more) ajax requests running in the background pinging other servers to tally prices for a travel quote site. Sort of like those interlaced GIF images back in the day, his page pops with basic information then progressively renders other parts. So his example has maybe 10 threads forked for one page to fully load and shows updates inline. </div><div class=""><br class=""></div><div class="">I was thinking more of one page WAProgress (I made that up) with one forked thread that monitors its execution and returns when it either completes, errors, or the user clicks a cancel link. </div><div class=""><br class=""></div><div class="">These are things baked into WebObjects (NeXT / Apple) and is what my buddies and I use daily. We are tiptoeing around the idea of starting new web development projects with Smalltalk / Seaside and testing the waters. </div><div class=""><br class=""></div><div class="">I’ve setup a public demo app / repo to test out these concepts: <br class=""><div class=""><br class=""></div><div class=""><a href="https://github.com/recurve/ScriptaculistPharoHeySql/" class="">https://github.com/recurve/ScriptaculistPharoHeySql/</a></div><div class=""><br class=""></div><div class="">It’s an address book application. What I’ll do is modify the delete of a contact to fork and render the Progress component and programmatically make the delete slow to show the feature. By the way, how do I do the equivalent of “Thread.sleep()” in Smalltalk? </div></div><div class=""><br class=""></div><div class="">Thanks in advance for any advice you may have,</div><div class="">— Aaron</div></body></html>