<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Aug 16, 2010, at 3:54 PM, Marcin Pawlowski wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Great. Thanks a lot.<br><br>We using both of them 1) using a web service and 2) running the <br>program on the local machine.<br></div></blockquote><div><br></div>Hi Marcin,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Unfortunately Conrad is sick today, so I'll try to answer the web service question without causing too much damage. :-) So the answer depends a bit on how the back-end web service is implemented. If it's implemented as an Opal service, you should look at the StructureDiagram.ws module, in particular the CDKDepictionService._runAsTask method. It's probably more efficient for you to ask questions about the code than to have me explain it line by line. Besides, I think it's actually pretty straightforward in this case.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>If the web service is implemented by REST, try looking at the ModBase.gui module, particularly the FetchScore._submitJob method. That method posts a multipart form to a REST service and reads back the result. You could adapt that code and use the same task "wrapper" that the Opal code uses.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>That code doesn't directly use a task wrapper because it is one of <i>many</i> requests that Chimera will be making to that web service (usually 10-20 at once), so it uses a queue to prevent overwhelming the remote server with requests. If your service will be making multiple requests at once then maybe you would want to do the same thing. If so, then look FetchScore.__init__ to see how the queue is set up (the httpq.get(), hq.newSlot(), and slot.request() calls) and then the end of the FetchScore._submitJob method to see how secondary requests to the server (if any) can be added to the queue with q.put().</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Please feel free to ask more questions!</div><div><br></div><div>--Eric</div><div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div><div><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "><br></font></div></div><br><blockquote type="cite"><div>Quoting Conrad Huang <<a href="mailto:conrad@cgl.ucsf.edu">conrad@cgl.ucsf.edu</a>>:<br><br><blockquote type="cite">Chimera has code for running jobs in the background while keeping <br></blockquote><blockquote type="cite">the GUI active. Some of this code is still under development and I <br></blockquote><blockquote type="cite">would suggest using the daily build rather than 1.4.1. Here are the <br></blockquote><blockquote type="cite">relevant modules and an example:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">chimera.SubprocessMonitor<br></blockquote><blockquote type="cite"> Module for running and monitoring background process<br></blockquote><blockquote type="cite">chimera.tasks<br></blockquote><blockquote type="cite"> Module for display background tasks in the task manager interface<br></blockquote><blockquote type="cite">chimera.printer<br></blockquote><blockquote type="cite"> SubprocessMonitor is used in saveImage() to launch background POV-Ray<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">If you are using a web service rather than running the program on <br></blockquote><blockquote type="cite">the local machine, there are other modules that may be of interest.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Conrad<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 8/12/10 5:57 AM, Marcin Pawlowski wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">Dear Chimera developers.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Me and of my students are developing a chimera extension to deal with<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">protein structures.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Unfortunately, the execution of our plunging last at least 5 minutes,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">so during this time the chimera program is hinged. We would like to<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">execute the program in an asynchronous way.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Is it possible?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Please do not hesitate to contact us if you require further<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">information about our project.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Best regards,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Marcin Pawlowski<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Chimera-dev mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev">http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>_______________________________________________<br>Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br>http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev<br></div></blockquote></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: medium;"><br class="Apple-interchange-newline"></span></div></span> </div><br></body></html>