Publishes the finish request event, then pop the request from the stack.

Note that the order of the operations is important here, otherwise
operations such as {@link RequestStack::getParentRequest()} can lead to
weird results.
323704
private function finishRequest(Request $request, int $type)
    {
        $this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST);
        $this->requestStack->pop();
    }
652940
public function onKernelRequest(GetResponseEvent $event)
    {
        if ($event->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) {
            return;
        }

        $this->client->setFallbackType('HTTP');

        $this->resolver->set($event->getRequest());
    }
896604
@Override
	public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) {
		if (!isCanceled()) {
			final CompletableFuture<?> terminationFuture;

			if (payload != null) {
				// trigger the failure of the slot payload
				payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManagerLocation()));

				// wait for the termination of the payload before releasing the slot
				terminationFuture = payload.getTerminalStateFuture();
			} else {
				terminationFuture = CompletableFuture.completedFuture(null);
			}

			terminationFuture.whenComplete(
				(Object ignored, Throwable throwable) -> {
					// release directly (if we are directly allocated),
					// otherwise release through the parent shared slot
					if (getParent() == null) {
						// we have to give back the slot to the owning instance
						if (markCancelled()) {
							try {
								getOwner().returnLogicalSlot(this);
								releaseFuture.complete(null);
							} catch (Exception e) {
								releaseFuture.completeExceptionally(e);
							}
						}
					} else {
						// we have to ask our parent to dispose us
						getParent().releaseChild(this);

						releaseFuture.complete(null);
					}
				});
		}

		return releaseFuture;
	}
444301
public void publish(Object event) {
        Objects.requireNonNull(event, Required.EVENT.toString());
        
        this.eventBus.post(event);
        this.events.getAndIncrement();
    }
239849
public function publishSingle()
    {
        $owner = $this->owner;
        // get the last published version
        $original = null;
        if ($this->isPublished()) {
            $original = self::get_by_stage($owner->baseClass(), self::LIVE)
                ->byID($owner->ID);
        }

        // Publish it
        $owner->invokeWithExtensions('onBeforePublish', $original);
        $owner->writeToStage(static::LIVE);
        $owner->invokeWithExtensions('onAfterPublish', $original);
        return true;
    }
1209346
public void publishEvent(final ApplicationEvent event) {
        if (this.eventPublisher != null) {
            LOGGER.trace("Publishing event [{}]", event);
            this.eventPublisher.publishEvent(event);
        }
    }
405669
final void postComplete() {
        /*
         * On each step, variable f holds current dependents to pop
         * and run.  It is extended along only one path at a time,
         * pushing others to avoid unbounded recursion.
         */
        CompletableFuture<?> f = this; Completion h;
        while ((h = f.stack) != null ||
               (f != this && (h = (f = this).stack) != null)) {
            CompletableFuture<?> d; Completion t;
            if (f.casStack(h, t = h.next)) {
                if (t != null) {
                    if (f != this) {
                        pushStack(h);
                        continue;
                    }
                    h.next = null;    // detach
                }
                f = (d = h.tryFire(NESTED)) == null ? this : d;
            }
        }
    }
983060
public function pushRequest(TaskEvent $event)
    {
        $task = $this->taskRepository->findByTaskId($event->getTask()->getUuid());
        if (!$task) {
            // current task is not managed by this bundle

            return;
        }

        $request = new Request(
            [],
            [],
            ['_task_id' => $event->getTask()->getUuid()],
            [],
            [],
            ['SERVER_NAME' => $task->getHost(), 'HTTPS' => $task->getScheme() === 'http' ? 'off' : 'on']
        );

        $this->requestStack->push($request);
    }
1175229
<T> void finish(Request<T> request) {
        // Remove from the set of requests currently being processed.
        synchronized (currentRequests) {
            currentRequests.remove(request);
        }
        if (request.shouldCache()) {
            synchronized (waitingRequests) {
                String cacheKey = request.getCacheKey();
                Queue<Request<?>> waitingRequests = this.waitingRequests.remove(cacheKey);
                if (waitingRequests != null) {
                    //todo add queue markers
//                    if (JusLog.DEBUG) {
//                        JusLog.v("Releasing %d waiting requests for cacheKey=%s.",
//                                waitingRequests.size(), cacheKey);
//                    }
                    // Process all queued up requests. They won't be considered as in flight, but
                    // that's not a problem as the cache has been primed by 'request'.
                    cacheQueue.addAll(waitingRequests);
                }
            }
        }
    }
17429
@Override
    final void doRequest(SubscriptionImpl subscription, long unused) {
        if (requested() != 0) {
            // Already have demand so don't need to do anything.
            return;
        }
        setRequested(1);
        notifySubscriberOfCloseEvent(subscription, SUCCESSFUL_CLOSE);
    }
1322057
public function onKernelRequest()
    {
        if ($this->executed) return;
        
        $installerScript = $this->scriptFactory->createScript('PostBootInstaller');
        $installerScript->setContainer($this->container)
                        ->executeActionsFromFile($this->basePath . '/.PostInstall');

        $installerScript = $this->scriptFactory->createScript('PostBootUninstaller');
        $installerScript->setContainer($this->container)
                        ->executeActionsFromFile($this->basePath . '/.PostUninstall');

        $this->executed = true;
    }
1106828
public function publishAction()
    {
        $this->container = $this->get('service_container');
        $this->denyAccessUnlessGranted('ROLE_ADMIN', null, 'No tienes permisos para acceder a este recurso!');
        $this->em = $this->get('doctrine.orm.entity_manager');

        $request = $this->get('request_stack')->getCurrentRequest();
        $id = $request->attributes->get('id');

        $entity = $this->get('doctrine.orm.entity_manager')->getRepository($this->getBundleName().':'.$this->getEntityNameUpper())->findOneBy(array(
            'id' => $id,
            //'namespace' => $this->getNamespace(),
        ));
        if (!$entity) {
            throw $this->CreateNotFoundException('Unable to find entity.');
        }
        $entity->setPublished(true);
        $this->em->persist($entity);
        $this->em->flush();

        return $this->newRedirectResponse('edemy_' . $this->getEntityPath($request->attributes->get('_route')) . '_index');
    }
1060103
protected final function doRequest()
    {
        $stepId = count($this->results);
        $request = $this->steps[$stepId]($this->results);
        $response = $this->requestor->doRequest($request);
        $this->checkGotResponse($response);
        $this->saveResult($stepId, $response);
    }
1024572
private void pop() throws SAXException {
        if (current == null) {
            throw new IllegalStateException("Bug!");
        }
        current.end();
        if (stack.isEmpty()) {
            current = null;
        } else {
            current = stack.removeLast();
        }
    }
5518
public function onKernelRequest()
    {
        $token = $this->tokenStorage->getToken();
        if (!$token) {
            return;
        }

        if (!$token instanceof UsernamePasswordToken) {
            return;
        }

        if ($token->getProviderKey() != 'backoffice') {
            return;
        }

        /** @var NodePublicationFilter $filter */
        $filter = $this->entityManager->getFilters()->enable('node_publication_filter');
        $filter->setApplyPublication(false);
    }
756855
public void complete() {
    // we have to traverse up to our parent, so be careful about locking.
    Progress myParent;
    synchronized(this) {
      progress = 1.0f;
      myParent = parent;
    }
    if (myParent != null) {
      // this will synchronize on the parent, so we make sure we release
      // our lock before getting the parent's, since we're traversing 
      // against the normal traversal direction used by get() or toString().
      // We don't need transactional semantics, so we're OK doing this. 
      myParent.startNextPhase();
    }
  }
1250412
public PushedPageFlow pop( HttpServletRequest request )
    {
        PushedPageFlow ppf = ( PushedPageFlow ) _stack.pop();
        PageFlowController pfc = ppf.getPageFlow();
        pfc.setIsOnNestingStack( false );
        
        if ( request != null )  // may be null if we're called from valueUnbound()
        {
            ServletContext servletContext = getServletContext();
            
            // Reinitialize the page flow, in case it's lost its transient state.
            pfc.reinitialize( request, null, servletContext );
            ensureFailover( request, servletContext );   // to ensure that this attribute is replicated for session failover
        }
        
        return ppf;
    }