Launch function for each manager in transaction priority.

@param \Closure $func
963769
protected function launch(\Closure $func)
    {
        foreach ($this->manager->getPool()->getPriority('transaction') as $managerName) {
            $func($this->manager->getPool()->getManager($managerName));
        }
    }
581269
public function after(callable $func)
    {
        $pattern = $this->setBaseRoute('{:all}');
        foreach (explode('|', 'GET|POST|PUT|PATCH|DELETE') as $method) {
            $this->after[$method][] = ['pattern' => $pattern, 'fn' => $func];
        }
    }
675460
def on_finish(self, func):
        '''
        '''
        if self._done.is_set():
            if self._failure is None:
                backend.schedule(func, args=(self._value,))
        else:
            self._cbacks.append(func)
634995
public function on(string $event, \Closure $closure): void
    {
        $this->events[$event] = $closure;
    }
96594
public function requireWhen(\Closure $closure) {
        $need = $closure();
        $this->check_role = 'require';
        $result = true;
        if ($need) {
            $result = !empty($this->value) || '0' == $this->value;
        }
        $this->checkResult($result);
    }
760702
public function inTransaction(Closure $closure): void
    {
        $connection = $this->getConnection();
        $connection->beginTransaction();
        try {
            $isOk = ($closure() === false ? null : true);
        } finally {
            isset($isOk) === true ? $connection->commit() : $connection->rollBack();
        }
    }
1325506
protected function addVars(\Closure $func)
    {
        $args = (new \ReflectionFunction($func))->getParameters();
        if (count($args) === 0) {
            return $func();
        }

        $fArgs = array_map(function($key) {
            return $this->values[$key];
        },
            array_map(function($arg) {
                return $arg->getName();
            },
                $args
            )
        );

        return call_user_func_array($func, $fArgs);
    }
311859
public function update($table, Closure $closure)
    {
        $blueprint = $this->createBlueprint($table, $closure);
        $blueprint->update();
    }
941554
public static function call($function, \Closure $callback = null)
    {
        $result = null;
        if (is_array($function)) {
            $result = self::methodDI($function, $callback);
        } elseif (is_callable($function, true)) {
            $result = self::functionDI($function, $callback);
        }
        return $result;
    }
1110595
public function afterEach(\Closure $closure)
    {
        $key = 'afterEach';
        $afterEach = new Hook($key, $closure, $this->current);
        $this->current->setHook($key, $afterEach);
    }
691623
public function register_gc_handler($func)
    {
        foreach ($this->gc_handlers as $handler) {
            if ($handler == $func) {
                return;
            }
        }

        $this->gc_handlers[] = $func;
    }
452077
public function listen(Closure $callback)
    {
        if (isset($this->events)) {
            $this->events->listen(Events\QueryExecuted::class, $callback);
        }
    }
961552
public static function run($function=null,$callback=null) {
        $that = self::instance();

        if($function instanceof \Closure) {
            $callback = $function;
            $function = Router::driver()->function;
        }

        $that->on($that->defaultCall,$callback);

        return $that->with($function);
    }
160180
public function run($commands, Closure $callback = null)
    {
        foreach ($this->connections as $connection) {
            $connection->run($commands, $callback);
        }
    }
607990
public function callWithDisabledAuth(Closure $closure)
    {
        if ($this->isDisabledAuth()) {
            return call_user_func($closure);
        }

        try {
            $this->disableAuth();

            return call_user_func($closure);
        } finally {
            $this->enableAuth();
        }
    }
53649
protected function exceptional(\Closure $func)
    {
        try {
            $result = $func();
        } catch (QueueException $e) {
            throw $e;
        } catch (\Exception $e) {
            throw new QueueException($this->queue, $e->getMessage(), 0, $e);
        }

        return $result;
    }
115063
public function map(Closure $func)
    {
        $clone = clone $this;

        $clone->data = array_map($func, $this->data);
        $clone->updateBody();

        return $clone;
    }