/** * Activates a page flow instance. * * @param mixed $payload */ public function activate($payload) { if (!is_null($this->garbageCollector)) { $this->garbageCollector->mark(); } $this->pageFlowInstance = $this->createPageFlowInstance($payload); $this->pageFlowInstance->activate($this->continuationContextProvider->getEventID()); if (!is_null($this->garbageCollector) && !$this->pageFlowInstanceRepository->checkPageFlowIsExclusive($this->pageFlowInstance)) { $this->garbageCollector->update($this->pageFlowInstance->getID()); } self::$activeInstances[] = $this; if (!self::$shutdownRegistered) { self::$shutdownRegistered = true; register_shutdown_function(array(__CLASS__, 'shutdown')); } }