Title: [122618] trunk/Tools
Revision
122618
Author
[email protected]
Date
2012-07-13 12:11:12 -0700 (Fri, 13 Jul 2012)

Log Message

webkitpy: make worker.start() and worker.stop() optional in the messagepool
https://bugs.webkit.org/show_bug.cgi?id=91170

Reviewed by Ojan Vafai.

test-webkitpy will use messagepool workers that don't actually
have any per-worker state, so they don't need start() and stop()
methods. Now we will only call the methods if they exist; this
means that workers only need to expose a handle() method.

* Scripts/webkitpy/common/message_pool.py:
(_Worker.terminate):
(_Worker.run):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (122617 => 122618)


--- trunk/Tools/ChangeLog	2012-07-13 19:10:22 UTC (rev 122617)
+++ trunk/Tools/ChangeLog	2012-07-13 19:11:12 UTC (rev 122618)
@@ -1,5 +1,21 @@
 2012-07-13  Dirk Pranke  <[email protected]>
 
+        webkitpy: make worker.start() and worker.stop() optional in the messagepool
+        https://bugs.webkit.org/show_bug.cgi?id=91170
+
+        Reviewed by Ojan Vafai.
+
+        test-webkitpy will use messagepool workers that don't actually
+        have any per-worker state, so they don't need start() and stop()
+        methods. Now we will only call the methods if they exist; this
+        means that workers only need to expose a handle() method.
+
+        * Scripts/webkitpy/common/message_pool.py:
+        (_Worker.terminate):
+        (_Worker.run):
+
+2012-07-13  Dirk Pranke  <[email protected]>
+
         NRWT doesn't print exceptions
         https://bugs.webkit.org/show_bug.cgi?id=91129
 

Modified: trunk/Tools/Scripts/webkitpy/common/message_pool.py (122617 => 122618)


--- trunk/Tools/Scripts/webkitpy/common/message_pool.py	2012-07-13 19:10:22 UTC (rev 122617)
+++ trunk/Tools/Scripts/webkitpy/common/message_pool.py	2012-07-13 19:11:12 UTC (rev 122618)
@@ -209,7 +209,8 @@
 
     def terminate(self):
         if self._worker:
-            self._worker.stop()
+            if hasattr(self._worker, 'stop'):
+                self._worker.stop()
             self._worker = None
         if self.is_alive():
             super(_Worker, self).terminate()
@@ -235,7 +236,8 @@
         _log.debug("%s starting" % self.name)
 
         try:
-            worker.start()
+            if hasattr(worker, 'start'):
+                worker.start()
             while True:
                 message = self._messages_to_worker.get()
                 if message.from_user:
@@ -254,7 +256,8 @@
             self._raise(sys.exc_info())
         finally:
             try:
-                worker.stop()
+                if hasattr(worker, 'stop'):
+                    worker.stop()
             finally:
                 self._post(name='done', args=(), from_user=False)
             self._close()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to