Runs the function synchronously taking care of exceptions.
492024
def synchronous(function, event):
    
    try:
        function(event)
    except Exception as error:
        logger = get_function_logger(function)
        logger.exception(error)
800212
@Override
    public void run() {
        synchronized (lock) {
            if (mIsDone || mIsCancelled) {
                return;
            }
            mIsStarted = true;
        }

        try {
            t = mCallable.call();
        } catch (Exception e) {
            e.printStackTrace();
        }

        synchronized (lock) {
            mIsDone = true;
            lock.notifyAll();
        }

    }
445595
def run(self):
        """"""
        self.exc = None
        try:
            self.task()
        except BaseException:
            self.exc = sys.exc_info()
588314
def run(self):
        
        try:
            self._loop()
        except Exception:
            # Send the exception through the exc_queue, so the parent
            # process can check it.
            typ, val, tb = sys.exc_info()
            tb_lines = traceback.format_exception(typ, val, tb)
            self.exc_queue.put((val, tb_lines))
1229597
private void tryRunNext() {
        while (runningSemaphore.tryAcquire()) {
            ExecutionTask execution = queue.poll();
            if (execution != null) {
                // Note: we've removed the execution from the queue so we're committed to running it
                // if we fail to do so for any reason, we need to call the exception handler to fail the execution
                try {
                    execution.submit();
                } catch (Throwable e) {
                    // Any exception here is unexpected
                    runningSemaphore.release();
                    execution.exceptionHandler.handle(e);
                }
            } else {
                runningSemaphore.release();
                break;
            }
        }
    }
891062
def run(
        self
        ):
        
        if self._function and not self._kwargs:
            return self._function()
        if self._function and self._kwargs:
            return self._function(**self._kwargs)
170940
public void run() {
		try {
			Object result = execute();
			if (!aborted) {
				this.retval = result;
				finished = true;
			}
		}
		catch (InterruptedException ie) {
			//
		}
		catch (Throwable t) {
			execException = t;
			finished = true;
		}
	}
133289
def run(self, func, *func_args, **func__kwargs):
        
        self._func = func
        self._func_args = func_args
        self._func_kwargs = func__kwargs
        return self
833115
@Override
    public void run() {
        try {
            handle();
        } catch (Exception e) {
            Throwables.throwIfUnchecked(e);
            throw new RuntimeException(e);
        }
    }
552055
def run_callback(self):
        

        if self._callback_func is not None:
            try:
                self._callback_func(self._request, self._result)
            except Exception:  # pylint: disable=broad-except
                LOGGER.exception('An unhandled error occurred while running '
                                 'future callback')
129929
def run_task(func):
    

    def _wrapped(*a, **k):
        loop = asyncio.get_event_loop()
        return loop.run_until_complete(func(*a, **k))

    return _wrapped
258403
def main_loop(self, timeout=None):
        
        if self.trigger_event.wait(timeout):
            try:
                self.func()
            except Exception as e:
                self.logger.warning("Got an exception running {func}: {e}".format(func=self.func, e=str(e)))
            finally:
                self.trigger_event.clear()
498964
def run(self):
        ''''''
        while not self.wait(self.delay()):
            try:
                logger.info('Invoking callback %s', self.callback)
                self.callback()
            except StandardError:
                logger.exception('Callback failed')
1188742
def _sync_call(self, func):
        

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            if self._start_msg:
                self._start_print()
            result = func(*args, **kwargs)
            if self._end_msg:
                print(self._end_msg)
            return result

        setattr(wrapper, ANNOTATED, True)
        return wrapper
444825
def synchronize (lock, func, log_duration_secs=0):
    """"""
    def newfunc (*args, **kwargs):
        """Execute function synchronized."""
        t = time.time()
        with lock:
            duration = time.time() - t
            if duration > log_duration_secs > 0:
                print("WARN:", func.__name__, "locking took %0.2f seconds" % duration, file=sys.stderr)
            return func(*args, **kwargs)
    return update_func_meta(newfunc, func)
780865
def run(self):
        
        try:
            threading.Thread.run(self)
        except Exception:
            t, v, tb = sys.exc_info()
            error = traceback.format_exception_only(t, v)[0][:-1]
            tback = (self.name + ' Traceback (most recent call last):\n' +
                     ''.join(traceback.format_tb(tb)))
            self.fifo.put((self.name, error, tback))
969558
def _run(self):
        
        tup = self.read_tuple()
        self._current_tups = [tup]
        if self.is_heartbeat(tup):
            self.send_message({"command": "sync"})
        elif self.is_tick(tup):
            self.process_tick(tup)
            if self.auto_ack:
                self.ack(tup)
        else:
            self.process(tup)
            if self.auto_ack:
                self.ack(tup)
        # Reset _current_tups so that we don't accidentally fail the wrong
        # Tuples if a successive call to read_tuple fails.
        # This is not done in `finally` clause because we want the current
        # Tuples to fail when there is an exception.
        self._current_tups = []