Executed prior to processing a request.
2411
def prepare(self, context):
		""""""
		if __debug__:
			log.debug("Assigning thread local request context.")
		
		self.local.context = context
600901
def process_request(self):
        """"""
        self.response = self.request_handler.process_request(
            self.method, self.request_data)
129329
@Override
  public void done() {
    final int processing_time = processingTimeMillis();
    httplatency.add(processing_time);
    logInfo("HTTP " + request().getUri() + " done in " + processing_time + "ms");
    deferred.callback(null);
  }
165830
protected function before() {
		if($this->connection->getDatabasePlatform() instanceof SQLServerPlatform) {
			$this->connection->executeUpdate('EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"');
		} else if($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
			$this->connection->executeUpdate('SET FOREIGN_KEY_CHECKS=0');
		} else if($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
			$this->connection->executeUpdate('PRAGMA foreign_keys = OFF');
		}
	}
467827
public function beforeRequest()
    {
        $this->_ajax = array();

        if (count($this->beforeRequestEvents) > 0) {
            foreach ($this->beforeRequestEvents as $event) {
                $event->onEvent($this);
            }
        }
    }
1170765
def mark_as_executed(self, req: Request):
        
        state = self[req.key]
        state.executed = True
        self._clean(state)
698754
def prepare_request(self, request):
        """"""
        try:
            request_id = local.request_id
        except AttributeError:
            request_id = NO_REQUEST_ID

        if self.request_id_header and request_id != NO_REQUEST_ID:
            request.headers[self.request_id_header] = request_id

        return super(Session, self).prepare_request(request)
613710
public void beforeCompletion()
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion");
        becomePreparing(); // Change the state to PREPARRING
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion");
    }
561768
async def pre_handle(self, request: Request, responder: 'Responder'):
        

        responder.send([lyr.Typing()])
        await responder.flush(request)
        responder.clear()

        await self.next(request, responder)
1043636
protected function beforeRequest()
    {
        if ($this->recreateApplication) {
            $this->resetApplication();
            return;
        }

        $application = $this->getApplication();

        $this->resetResponse($application);
        $this->resetRequest($application);

        $definitions = $application->getComponents(true);
        foreach ($this->recreateComponents as $component) {
            // Only recreate if it has actually been instantiated.
            if ($application->has($component, true)) {
                $application->set($component, $definitions[$component]);
            }
        }
    }
64580
protected final <T extends AmazonWebServiceRequest> T beforeClientExecution(T request) {
        T local = request;
        for (RequestHandler2 handler : requestHandler2s) {
            local = (T) handler.beforeExecution(local);
        }
        return local;
    }
1189830
public function beforeRequest(Request $request, Application $app)
    {
        $this->root = $request->attributes->get('_root');
    }
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
183642
async def preprocess_request(
        self, request_context: Optional[RequestContext]=None,
    ) -> Optional[ResponseReturnValue]:
        
        request_ = (request_context or _request_ctx_stack.top).request
        blueprint = request_.blueprint
        processors = self.url_value_preprocessors[None]
        if blueprint is not None:
            processors = chain(processors, self.url_value_preprocessors[blueprint])  # type: ignore
        for processor in processors:
            processor(request.endpoint, request.view_args)

        functions = self.before_request_funcs[None]
        if blueprint is not None:
            functions = chain(functions, self.before_request_funcs[blueprint])  # type: ignore
        for function in functions:
            result = await function()
            if result is not None:
                return result
        return None
1071269
protected function BeforeInit()
    {
        if ($this->RemoveTemplate())
        {
            Response::Redirect(Request::Uri());
            return true;
        }
        parent::BeforeInit();
    }
854324
public static void before(String path, String acceptType, Filter... filters) {
        for (Filter filter : filters) {
            getInstance().before(path, acceptType, filter);
        }
    }
3232
def before(complete = true, index = 0, &block)
        unless @before_run
          while callback = machine.callbacks[:before][index]
            index += 1
            
            if callback.type == :around
              # Around callback: need to handle recursively.  Execution only gets
              # paused if:
              # * The block fails and the callback doesn't run on failures OR
              # * The block succeeds, but after callbacks are disabled (in which
              #   case a continuation is stored for later execution)
              return if catch(:cancel) do
                callback.call(object, context, self) do
                  before(complete, index, &block)
                  
                  pause if @success && !complete
                  throw :cancel, true unless @success
                end
              end
            else
              # Normal before callback
              callback.call(object, context, self)
            end
          end
          
          @before_run = true
        end
        
        action = {:success => true}.merge(block_given? ? yield : {})
        @result, @success = action[:result], action[:success]
      end