Set the flow associated to this :class:`Work`.
514698
def set_flow(self, flow):
        """"""
        if not hasattr(self, "_flow"):
            self._flow = flow
        else:
            if self._flow != flow:
                raise ValueError("self._flow != flow")
354639
public void setWorkState(WorkState workState)
   {
      this.workState =  workState;
      
      SupervisedWorker worker = null;
      for (Iterator<SupervisedWorker> i = workers.iterator(); i.hasNext();)
      {
         worker = (SupervisedWorker) i.next();
         workState.advise(worker);
      }
      
      //threads
      Thread workerThread = null;
      
      for (Iterator<SupervisedWorker> i = workers.iterator(); i.hasNext();)
      {
         worker = i.next();
         workerThread = worker.getThread();
         if(workerThread != null)
         {
            try { workerThread.join(); } catch(Exception e){}   
         }
      }
   }
1304569
def _set_duty(self, motor_duty_file, duty, friction_offset,
                  voltage_comp):
        """"""
        # Compensate for nominal voltage and round the input
        duty_int = int(round(duty*voltage_comp))

        # Add or subtract offset and clamp the value between -100 and 100
        if duty_int > 0:
            duty_int = min(100, duty_int + friction_offset)
        elif duty_int < 0:
            duty_int = max(-100, duty_int - friction_offset)

        # Apply the signal to the motor
        self._fast_write(motor_duty_file, duty_int)
1153812
def setWorker(self, *args, **kwargs):
        
        try:
            la = self.LAUNCHING_ARGUMENTS(*args, **kwargs)
        except TypeError as e:
            scoop.logger.error(("addWorker failed to convert args %s and kwargs %s "
                            "to namedtuple (requires %s arguments (names %s)") %
                            (args, kwargs, len(self.LAUNCHING_ARGUMENTS._fields),
                             self.LAUNCHING_ARGUMENTS._fields))

        self.workersArguments = la
293890
def _set_flow_rate(pipette, params) -> None:
    
    flow_rate_param = params['flowRate']

    if not (flow_rate_param > 0):
        raise RuntimeError('Positive flowRate param required')

    pipette.flow_rate = {
        'aspirate': flow_rate_param,
        'dispense': flow_rate_param
    }
606311
def adjust_flow(self, category):
        """"""

        status = flow_control.SKIP
        for allow in self.allow:
            if self.match(category, allow):
                status = flow_control.ALLOW
                for skip in self.skip:
                    if self.match(category, skip):
                        status = flow_control.SKIP
                for halt in self.halt:
                    if self.match(category, halt):
                        status = flow_control.HALT
                if status != flow_control.ALLOW:
                    break
        return status
1103770
def run(self):
        """"""
        while True:
            if self._dismissed.isSet():
                # we are dismissed, break out of loop
                break

            # get next work request.
            request = self._requests_queue.get()
            # print 'Worker thread %s running request %s' %(self, request)

            if self._dismissed.isSet():
                # we are dismissed, put back request in queue and exit loop
                self._requests_queue.put(request)
                break
            try:
                result = request.callable(*request.args, **request.kwds)
                if request.callback:
                    request.callback(request, result)
                del result
                self._requests_queue.task_done()
            except:
                request.exception = True
                if request.exc_callback:
                    request.exc_callback(request)
                self._requests_queue.task_done()
            finally:
                request.self_destruct()
429465
def executing(self):
    """"""
    self._set_target_root_count_in_runtracker()
    yield
    metrics = self._scheduler.metrics()
    self.run_tracker.pantsd_stats.set_scheduler_metrics(metrics)
    engine_workunits = self._scheduler.engine_workunits(metrics)
    if engine_workunits:
      self.run_tracker.report.bulk_record_workunits(engine_workunits)
    self._set_affected_target_count_in_runtracker()
949828
def set_paused_state(self):
        """"""
        if self.chosen_config_path is not None:
            save_cfg_vals_to_git_cfg(config_path=self.chosen_config_path)
        set_state(WORKFLOW_STATES.BACKPORT_PAUSED)
41750
public static function onWorkerStart() {
		Yesf::app()->loadEnvConfig();
		Yesf::loadProjectConfig();
		Logger::init();
		Response::init();
		Response::initInWorker();
		Utils::setRDAlias();
		Utils::setCacheAlias();
		Pool::init();
	}
1070610
def set(self, value):
        """"""
        value = min(self.max, max(self.min, value))
        self._value = value
        start_new_thread(self.func, (self.get(),))
655537
def _write(self, data):
        """"""
        stream = yaml.dump(data, default_flow_style=False)
        self.path.write_text(stream)
889610
protected function work(): void
    {
        if (@$this->worker->work()
            || $this->worker->returnCode() == GEARMAN_IO_WAIT
            || $this->worker->returnCode() == GEARMAN_NO_JOBS
        ) {
            if ($this->worker->returnCode() == GEARMAN_SUCCESS) {
                return;
            }

            if (!@$this->worker->wait()) {
                if ($this->worker->returnCode() == GEARMAN_NO_ACTIVE_FDS) {
                    sleep(5);
                }
            }
        }
    }
605544
public function onAfterWrite()
    {
        $instance = $this->getWorkflowInstance();
        if ($instance && $instance->CurrentActionID) {
            $action = $instance->CurrentAction()->BaseAction()->targetUpdated($instance);
        }
    }
567303
def setWorkerInfo(self, hostname, workerAmount, origin):
        """"""

        scoop.logger.debug('Initialising {0}{1} worker {2} [{3}].'.format(
            "local" if hostname in utils.localHostnames else "remote",
            " origin" if origin else "",
            self.workersLeft,
            hostname,
            )
        )

        add_args, add_kwargs = self._setWorker_args(origin)
        self.workers[-1].setWorker(*add_args, **add_kwargs)
        self.workers[-1].setWorkerAmount(workerAmount)
605566
def send_work(self):
        '''
        '''
        if self.__set_running():
            # msg = FutureRequest(FUTURE, self.__method, self.__params,
            #                     self.__channel, self.__target, self.__id)
            msg = {TYPE: FUTURE, METHOD: self.__method, PARAMS: self.__params,
                   CHANNEL: self.__channel, TO: self.__target,
                   RPC_ID: self.__id}
            self.__actor_channel.send(msg)
        else:
            raise FutureError("Future already running.")
1298774
def _set(self):
        """"""
        self.__event.set()
        if self._complete_func:
            self.__run_completion_func(self._complete_func, self.id_)