Gracefully remove a value from the cache map

@param string $name The key of the value to remove
@param callable $callback An optional callback to handle the existing value
353285
protected function reset(string $name, callable $callback = null)
    {
        if (!isset($this->cache[$name])) {
            return;
        }

        if ($callback !== null) {
            call_user_func($callback, $name, $this->cache[$name]);
        }

        unset($this->cache[$name]);
    }
152914
final public function unsetCache($name) {
	
		if (is_array($this->cache) and isset($this->cache[$name])) {
		unset ($this->cache[$name]);
		}
	
	}
1277357
public function register(string $name, callable $callback): ResolverInterface
    {
        //if it's not callable
        if (!is_callable($callback)) {
            throw ResolverException::forInvalidCallback();
        }

        $this->registry[$name] = $callback;
        return $this;
    }
784202
public function register_function($name, $callback, $cacheable = true, $cache_attrs = null)
    {
        if (isset($this->plugins[$name]) && $this->plugins[$name][0] !== self::SMARTY_FUNCTION) {
            throw new Exception('Multiple plugins of different types can not share the same name');
        }
        $this->plugins[$name] = array(
            'type'     => self::SMARTY_FUNCTION,
            'callback' => $callback
        );
    }
283812
public static function deleteListener(String $eventName, $callback = NULL) : Bool
    {
        return Listener::delete($eventName, $callback);
    }
573385
public function removeReturnListener(callable $callback)
    {
        foreach ($this->returnCallbacks as $k => $v) {
            if ($v === $callback) {
                unset($this->returnCallbacks[$k]);
            }
        }

        return $this;
    }
7989
protected static function _isCallablePluginData($name, $plugin, $callback)
    {
        if (Arr::in($name, self::$_manifestEvents) &&
            !isset(self::$_eventList[$name][$plugin]) &&
            is_callable($callback)
        ) {
            return true;
        }

        return false;
    }
1142576
public function run($name, $callback) {
        if (!is_callable($callback)) {
            throw new \InvalidArgumentException('$callback is not callable');
        }

        // Because, we need to remove exists Instance before fork
        $this->Storage->setup();

        $pid = pcntl_fork();
        if ($pid === -1) {
            return false;
        }
        if ($pid) {
            // main fork
            $this->pids[$name] = $pid;
            return true;
        } else {
            $result = call_user_func($callback);
            $this->Storage->set($this->getKey(), $name, $result);
            exit(0);
        }
    }
452801
public function addRuleCallback($name, Callable $callback)
    {
        if (!is_string($name)) {
            throw new \InvalidArgumentException('Rule must be a string');
        }

        $rule = $this->createRuleCallback($name, $callback);
        $this->addRule($rule);
    }
935632
public function deleteExchange($name, array $options = [], callable $callback = null)
    {
        $ifUnused = array_key_exists('ifUnused', $options) ? (bool)$options['ifUnused'] : null;
        $noWait = array_key_exists('noWait', $options) ? (bool)$options['noWait'] : null;

        $outputFrame = Exchange\ExchangeDeleteFrame::create($name, $ifUnused, $noWait);
        $outputFrame->frameChannelId = $this->id;
        $this->connection->command($outputFrame);

        if (is_callable($callback)) {
            $this->on(self::EVENT_ON_CHANNEL_DELETE_EXCHANGE_CALLBACK, $callback);
        }
    }
641488
public function removeEventListener(string $name, callable $listener): self
    {
        if (isset($this->internalEventListenersData[$name])) {
            foreach ($this->internalEventListenersData[$name] as $i => $value) {
                if ($value === $listener) {
                    unset($this->internalEventListenersData[$name][$i]);
                    if (empty($this->internalEventListenersData[$name])) {
                        unset($this->internalEventListenersData[$name]);
                    }
                    break;
                }
            }
        }
        return $this;
    }
827410
public function withAttr($name, $callback = null)
    {
        if (is_array($name)) {
            $this->options['with_attr'] = $name;
        } else {
            $this->options['with_attr'][$name] = $callback;
        }

        return $this;
    }
572706
public function register(string $name, $callback) : Event
    {
        if (is_null($name)) {
            throw new \RuntimeException(sprintf('Event name cannot be empty in %s', __FUNCTION__));
        }

        if (is_null($callback)) {
            throw new \RuntimeException(sprintf('Empty parameter passed as callback in %s function', __FUNCTION__));
        }

        if (!isset($this->events[$name])) {
            $this->events[$name] = [];
        }

        if (!in_array($callback, $this->events[$name])) {
            $this->events[$name][] = $callback;
        }

        return $this;
    }
304951
public function addCallback(string $name, $callback)
    {
        if (!is_object($callback)) {
            throw new \InvalidArgumentException('Given callback must be an object');
        }

        $this->callbacks[$name] = $callback;
    }
483334
public function filter($name, $callback)
	{
		$this->events->listen('router.filter: '.$name, $this->parseFilter($callback));
	}
1347719
public function send($name = '', callable $callback)
    {
        $configs = Config::get($name);
        $driver = $this->driver(isset($configs['driver']) ? $configs['driver']: 'swift', $configs);

        return $callback($driver);
    }
374658
public function onRegister($name, Closure $callback)
    {
        $priority                  = $this->getPluginPriority($name);
        $this->registerCallbacks[] = compact('name', 'priority', 'callback');
    }