def action(self):
        '''
        Read in a command and execute it, send the return back up to the
        main master process
        '''
        self.lane_stack.value.serviceAll()
        while self.lane_stack.value.rxMsgs:
            msg, sender = self.lane_stack.value.rxMsgs.popleft()
            try:
                s_estate, s_yard, s_share = msg['route']['src']
                d_estate, d_yard, d_share = msg['route']['dst']
            except (ValueError, __HOLE__):
                log.error('Received invalid message: {0}'.format(msg))
                return

            log.debug("**** Worker Router rxMsg\n   msg= {0}\n".format(msg))

            if 'load' in msg:
                cmd = msg['load'].get('cmd')
                if not cmd:
                    continue
                elif cmd.startswith('__'):
                    continue
                ret = {}
                if d_share == 'remote_cmd':
                    if hasattr(self.remote_loader.value, cmd):
                        ret['return'] = getattr(self.remote_loader.value, cmd)(msg['load'])
                elif d_share == 'local_cmd':
                    if hasattr(self.local_loader.value, cmd):
                        ret['return'] = getattr(self.local_loader.value, cmd)(msg['load'])
                else:
                    ret = {'error': 'Invalid request'}
                if cmd == 'publish' and 'pub' in ret.get('return', {}):
                    r_share = 'pub_ret'
                    ret['__worker_verify'] = self.worker_verify.value
                else:
                    r_share = s_share
                if cmd not in INHIBIT_RETURN:
                    ret['route'] = {
                            'src': (None, self.lane_stack.value.local.name, None),
                            'dst': (s_estate, s_yard, r_share)
                            }
                    self.lane_stack.value.transmit(ret,
                            self.lane_stack.value.fetchUidByName('manor'))
                    self.lane_stack.value.serviceAll()
dataset/ETHPy150Open saltstack/salt/salt/daemons/flo/worker.py/SaltRaetWorkerRouter.action