Changeset 78159 in webkit


Ignore:
Timestamp:
Feb 9, 2011 4:09:34 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-02-09 Dirk Pranke <dpranke@chromium.org>

Reviewed by Tony Chang.

nrwt multiprocessing: minor cleanup prior to implementing the new worker

This patch renames AbstractManager to ManagerConnection and
changes some argument names to be more consistent between
manager_worker_broker and message_broker. It also fixes a couple
of typos in message_broker. These changes will be tested by code
introduced in the next patch.

https://bugs.webkit.org/show_bug.cgi?id=54067

  • Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
  • Scripts/webkitpy/layout_tests/layout_package/message_broker2.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r78157 r78159  
     12011-02-09  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        nrwt multiprocessing: minor cleanup prior to implementing the new worker
     6
     7        This patch renames AbstractManager to ManagerConnection and
     8        changes some argument names to be more consistent between
     9        manager_worker_broker and message_broker. It also fixes a couple
     10        of typos in message_broker. These changes will be tested by code
     11        introduced in the next patch.
     12       
     13        https://bugs.webkit.org/show_bug.cgi?id=54067
     14
     15        * Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
     16        * Scripts/webkitpy/layout_tests/layout_package/message_broker2.py:
     17
    1182011-02-09  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py

    r77990 r78159  
    7878
    7979
    80 def get(port, options, manager, worker_class):
     80def get(port, options, client, worker_class):
    8181    """Return a connection to a manager/worker message_broker
    8282
     
    8484        port - handle to layout_tests/port object for port-specific stuff
    8585        options - optparse argument for command-line options
    86         manager - object to dispatch replies to
     86        client - object to dispatch replies to
    8787        worker_class - type of workers to create. This class must implement
    8888            the methods in AbstractWorker.
     
    106106
    107107    broker = message_broker2.Broker(options, queue_class)
    108     return manager_class(broker, port, options, manager, worker_class)
     108    return manager_class(broker, port, options, client, worker_class)
    109109
    110110
     
    137137
    138138
    139 class _AbstractManager(object):
    140     def __init__(self, broker, port, options, manager, worker_class):
     139class _ManagerConnection(message_broker2.BrokerConnection):
     140    def __init__(self, broker, port, options, client, worker_class):
    141141        """Base initialization for all Manager objects.
    142142
     
    145145            port: handle to port-specific functionality
    146146            options: command line options object
    147             manager: Manager callback object (the caller)
     147            client: callback object (the caller)
    148148            worker_class: class object to use to create workers.
    149149        """
    150         self._broker = broker
     150        message_broker2.BrokerConnection.__init__(self, broker, client,
     151            MANAGER_TOPIC, ANY_WORKER_TOPIC)
    151152        self._options = options
    152         self._manager = manager
    153153        self._worker_class = worker_class
    154154
    155155
    156 class _InlineManager(_AbstractManager):
     156class _InlineManager(_ManagerConnection):
    157157    pass
    158158
    159159
    160 class _ThreadedManager(_AbstractManager):
     160class _ThreadedManager(_ManagerConnection):
    161161    pass
    162162
    163163
    164 class _MultiProcessManager(_AbstractManager):
     164class _MultiProcessManager(_ManagerConnection):
    165165    pass
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/message_broker2.py

    r77989 r78159  
    133133
    134134    def _run_loop(self, topic_name, client, block, delay_secs):
    135         queue = self._find_topic(topic_name)
     135        queue = self._get_queue_for_topic(topic_name)
    136136        while not client.is_done():
    137137            try:
     
    147147               "%s: received message '%s' it couldn't handle" %
    148148               (client.name(), message.name))
    149         optargs = message.body
     149        optargs = message.args
    150150        message_handler = getattr(client, 'handle_' + message.name)
    151151        message_handler(message.src, *optargs)
Note: See TracChangeset for help on using the changeset viewer.