~xianghui/ubuntu/trusty/oslo.messaging/icehouse-lp1521958

« back to all changes in this revision

Viewing changes to oslo/messaging/_executors/impl_blocking.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-03-27 13:01:34 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140327130134-va1pxzs253r43n15
Tags: 1.3.0~a9-0ubuntu1
* New upstream release (LP: #1298970)
* debian/control:
  - Add python-oslotest as a build dependency.
  - Use python-oslosphinx instead of python-oslo.sphinx

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    for simple demo programs.
30
30
    """
31
31
 
32
 
    def __init__(self, conf, listener, callback):
33
 
        super(BlockingExecutor, self).__init__(conf, listener, callback)
 
32
    def __init__(self, conf, listener, dispatcher):
 
33
        super(BlockingExecutor, self).__init__(conf, listener, dispatcher)
34
34
        self._running = False
35
35
 
36
36
    def start(self):
37
37
        self._running = True
38
38
        while self._running:
39
 
            self._dispatch(self.listener.poll())
 
39
            with self.dispatcher(self.listener.poll()) as callback:
 
40
                callback()
40
41
 
41
42
    def stop(self):
42
43
        self._running = False