Initiate a sniffing task. Make sure we only have one sniff request
        running at any given time. If a finished sniffing request is around,
        collect its result (which can raise its exception).
13408
def initiate_sniff(self, initial=False):
        
        if self.sniffing_task and self.sniffing_task.done():
            try:
                if self.sniffing_task is not None:
                    self.sniffing_task.result()
            except:
                if self.raise_on_sniff_error:
                    raise
            finally:
                self.sniffing_task = None

        if self.sniffing_task is None:
            self.sniffing_task = ensure_future(self.sniff_hosts(initial), loop=self.loop)
62872
def start(self):
        """"""
        if not self.pipe is None:
            raise RuntimeError("Cannot start task twice")

        self.ioloop = tornado.ioloop.IOLoop.instance()
        if self.timeout > 0:
            self.expiration = self.ioloop.add_timeout( time.time() + self.timeout, self.on_timeout )
        self.pipe = subprocess.Popen(**self.args)

        self.streams = [ (self.pipe.stdout.fileno(), []),
                         (self.pipe.stderr.fileno(), []) ]
        for fd, d in self.streams:
            flags = fcntl.fcntl(fd, fcntl.F_GETFL)| os.O_NDELAY
            fcntl.fcntl( fd, fcntl.F_SETFL, flags)
            self.ioloop.add_handler( fd,
                                     self.stat,
                                     self.ioloop.READ|self.ioloop.ERROR)
558785
public function setUpBeforeSniff()
    {
        $this->visitor->getSubject()->dispatch(
            Reflect\Events::SNIFF,
            array(
                'method' => get_class($this) . '::' . __FUNCTION__,
                'node'   => null,
                'sniff'  => get_class($this),
            )
        );
    }
181399
def set_handler(self, handler):
        
        if self._handler:
            raise Exception('Handler was already set')
        if handler:
            self._handler = async_task(handler, loop=self._loop)
131775
def begin_call(self, method, *args):
        
        d = Deferred(self.loop)
        d.request = self.request_num
        self.requests[self.request_num] = d
        self.protocol.send_request(d.request, method, args)
        self.request_num += 1
        return d
1023738
public void start() throws ContextClientCodeException {
    synchronized (this.contextStack) {
      LOG.log(Level.FINEST, "Instantiating root context.");
      this.contextStack.push(this.launchContext.get().getRootContext());

      if (this.launchContext.get().getInitialTaskConfiguration().isPresent()) {
        LOG.log(Level.FINEST, "Launching the initial Task");
        try {
          this.contextStack.peek().startTask(this.launchContext.get().getInitialTaskConfiguration().get());
        } catch (final TaskClientCodeException e) {
          this.handleTaskException(e);
        }
      }
    }
  }
1037398
private void startProxy() throws Exception {
    mProxyProcess = ProxyProcess.Factory.create();
    Runnable runProxy = () -> {
      try {
        mProxyProcess.start();
      } catch (InterruptedException e) {
        // this is expected
      } catch (Exception e) {
        // Log the exception as the RuntimeException will be caught and handled silently by JUnit
        LOG.error("Start proxy error", e);
        throw new RuntimeException(e + " \n Start Proxy Error \n" + e.getMessage(), e);
      }
    };

    mProxyThread = new Thread(runProxy);
    mProxyThread.setName("ProxyThread-" + System.identityHashCode(mProxyThread));
    mProxyThread.start();
    TestUtils.waitForReady(mProxyProcess);
  }
104203
protected void start() {
        // if a periodic execution throws an exception, future executions are suspended,
        // this task wraps the call in a try-catch block to prevent that. Errors are still propagated.
        final Runnable resilientTask = () -> {
            try {
                run();
            } catch (final Exception e) {
                logger.error("[{}] Error during timeout-initiated flush", name, e);
            }
        };

        scheduler.scheduleAtFixedRate(resilientTask, 0, batchTimeout + salt, TimeUnit.MILLISECONDS);
    }
1201982
async def run_task(self) -> None:
        ''''''

        self.last_run = 0.0
        self.target = self.time() + self.DELAY

        while self.running:
            try:
                now = self.time()

                if now < self.target:
                    sleep = self.target - now
                    await self.sleep(sleep)

                elif self.last_run < self.target:
                    Log.debug('executing timer task %s', self.name)
                    self.last_run = self.time()
                    await self.run()
                    total = self.time() - self.last_run
                    Log.debug('finished timer task %s in %.1f seconds',
                              self.name, total)

                else:
                    sleep = min(5.0, self.DELAY)
                    await self.sleep(sleep)

            except CancelledError:
                Log.debug('cancelled timer task %s', self.name)
                raise

            except Exception:
                Log.exception('exception in timer task %s', self.name)
484126
def start(self, listen_ip=LISTEN_IP, listen_port=0):
        """"""
        coro = self.loop.create_datagram_endpoint(
            lambda: self, local_addr=(listen_ip, listen_port))

        self.task = self.loop.create_task(coro)
        return self.task
1137364
def start(self):
        

        # this shouldn't actually be possible still...
        if self.aitask is not None:
            self.stop()
            raise Exception("FIX ME : NESTED START OPERATIONS ALLOWED")

        self.daq_lock.acquire()

        self.ngenerated = 0
        self.nacquired = 0

        return self.reset()
303425
def begin_application(self, req, res):
        
        # Add the middleware processing to the event loop - this *should*
        # change the call stack so any server errors do not link back to this
        # function
        self.loop.create_task(self.http_application.handle_client_request(req, res))
1340043
def process_request(self, request):
        
        # Initialize thread local storage
        threadlocal.auditlog = {
            'signal_duid': (self.__class__, time.time()),
            'remote_addr': request.META.get('REMOTE_ADDR'),
        }

        # In case of proxy, set 'original' address
        if request.META.get('HTTP_X_FORWARDED_FOR'):
            threadlocal.auditlog['remote_addr'] = request.META.get('HTTP_X_FORWARDED_FOR').split(',')[0]

        # Connect signal for automatic logging
        if hasattr(request, 'user') and is_authenticated(request.user):
            set_actor = curry(self.set_actor, user=request.user, signal_duid=threadlocal.auditlog['signal_duid'])
            pre_save.connect(set_actor, sender=LogEntry, dispatch_uid=threadlocal.auditlog['signal_duid'], weak=False)
271962
public void start()
    throws Exception
  {
    if (_port < 0 && _unixPath == null) {
      return;
    }

    if (! _lifecycle.toStarting())
      return;

    boolean isValid = false;
    try {
      bind();
      postBind();

      enable();

      _acceptTask = new AcceptTcp(this, _serverSocket);
      _threadPool.execute(_acceptTask);

      // _connThreadPool.start();

      _suspendAlarm = new Alarm(new SuspendReaper());
      _suspendAlarm.runAfter(_suspendReaperTimeout);

      isValid = true;
    } finally {
      if (! isValid) {
        close();
      }
    }
  }
582623
def _execute_handling(self, *eopatches, **kwargs):
        
        self.private_task_config.start_time = datetime.datetime.now()

        caught_exception = None
        try:
            return_value = self.execute(*eopatches, **kwargs)
        except BaseException as exception:
            caught_exception = exception, sys.exc_info()[2]

        if caught_exception is not None:  # Exception is not raised in except statement to prevent duplicated traceback
            exception, traceback = caught_exception
            raise type(exception)('During execution of task {}: {}'.format(self.__class__.__name__,
                                                                           exception)).with_traceback(traceback)

        self.private_task_config.end_time = datetime.datetime.now()
        return return_value
92515
public void start()
        throws Exception
    {
        if (getHttpContext().getAuthenticator()==null)
        {
            // Find out the Authenticator.
            if (SecurityConstraint.__BASIC_AUTH.equalsIgnoreCase(_authMethod))
                getHttpContext().setAuthenticator(new BasicAuthenticator());
            else if (SecurityConstraint.__CERT_AUTH.equalsIgnoreCase(_authMethod))
                getHttpContext().setAuthenticator(new ClientCertAuthenticator());
            else
                log.warn("Unknown Authentication method:"+_authMethod);
        }
        
        super.start();
    }
508269
private void start()
    {
    try
      {
      // Initialize filter.
      initializeFilter( getFilterInput(), getFilterOutput());

      // Start filter thread.
      failure_ = null;
      thread_ = new Thread( this, String.valueOf( this));
      thread_.start();
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't start filtering", e);
      } 
    }