Changeset 122618 in webkit


Ignore:
Timestamp:
Jul 13, 2012 12:11:12 PM (12 years ago)
Author:
dpranke@chromium.org
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):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r122615 r122618  
     12012-07-13  Dirk Pranke  <dpranke@chromium.org>
     2
     3        webkitpy: make worker.start() and worker.stop() optional in the messagepool
     4        https://bugs.webkit.org/show_bug.cgi?id=91170
     5
     6        Reviewed by Ojan Vafai.
     7
     8        test-webkitpy will use messagepool workers that don't actually
     9        have any per-worker state, so they don't need start() and stop()
     10        methods. Now we will only call the methods if they exist; this
     11        means that workers only need to expose a handle() method.
     12
     13        * Scripts/webkitpy/common/message_pool.py:
     14        (_Worker.terminate):
     15        (_Worker.run):
     16
    1172012-07-13  Dirk Pranke  <dpranke@chromium.org>
    218
  • trunk/Tools/Scripts/webkitpy/common/message_pool.py

    r122615 r122618  
    210210    def terminate(self):
    211211        if self._worker:
    212             self._worker.stop()
     212            if hasattr(self._worker, 'stop'):
     213                self._worker.stop()
    213214            self._worker = None
    214215        if self.is_alive():
     
    236237
    237238        try:
    238             worker.start()
     239            if hasattr(worker, 'start'):
     240                worker.start()
    239241            while True:
    240242                message = self._messages_to_worker.get()
     
    255257        finally:
    256258            try:
    257                 worker.stop()
     259                if hasattr(worker, 'stop'):
     260                    worker.stop()
    258261            finally:
    259262                self._post(name='done', args=(), from_user=False)
Note: See TracChangeset for help on using the changeset viewer.