On Thu, Oct 29, 2009 at 4:41 PM, pjaromin <[email protected]> wrote: > I'm writing a remote service that executes a long-running process that > I'm updating on the client-side using a progress bar widget. > > What I'd like to do is have two methods in the service: > > String longRunningProcess(Request request); > > Progress checkProgress(String id); > > The question is, what's the best way to get the ID back to the client? > The UUID should be created on the server side -- but if I generate it > in the "longRunningProcess" method, it won't return until AFTER the > process is complete.
There's ProcessBuilder or Runtime.exec. Process.start() should return before the process is complete. It starts a subprocess so presumably if the JVM that started the process crashes, the subprocess goes away too. I'd probably use a database for the uuid gen (could just be a sequence) and to start the state of processes machinename/running/finished. You can get info from the process via output stream and error stream. There's this feature request for a getpid() method on Process. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4244896 Obviously I've left a lot of details out.. don't want to ruin all the fun. Also, I'm avail for part-time / consulting work ;) -Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
