public function execute()
	{
		// @event onBeforeExecute

		// Enable basic garbage collection.
		gc_enable();

		$this->getLogger()->info('Starting ' . $this->name);

		// Set off the process for becoming a daemon.
		if ($this->daemonize())
		{
			// Declare ticks to start signal monitoring. When you declare ticks, PCNTL will monitor
			// incoming signals after each tick and call the relevant signal handler automatically.
			declare (ticks = 1);

			// Start the main execution loop.
			while (true)
			{
				// Perform basic garbage collection.
				$this->gc();

				// Don't completely overload the CPU.
				usleep(1000);

				// Execute the main application logic.
				$this->doExecute();
			}
		}
		else
		// We were not able to daemonize the application so log the failure and die gracefully.
		{
			$this->getLogger()->info('Starting ' . $this->name . ' failed');
		}

		// @event onAfterExecute
	}
public function execute()
	{
		// @event onBeforeExecute

		// Enable basic garbage collection.
		gc_enable();

		$this->getLogger()->info('Starting ' . $this->name);

		// Set off the process for becoming a daemon.
		if ($this->daemonize())
		{
			// Declare ticks to start signal monitoring. When you declare ticks, PCNTL will monitor
			// incoming signals after each tick and call the relevant signal handler automatically.
			declare (ticks = 1);

			// Start the main execution loop.
			while (true)
			{
				// Perform basic garbage collection.
				$this->gc();

				// Don't completely overload the CPU.
				usleep(1000);

				// Execute the main application logic.
				$this->doExecute();
			}
		}
		else
		// We were not able to daemonize the application so log the failure and die gracefully.
		{
			$this->getLogger()->info('Starting ' . $this->name . ' failed');
		}

		// @event onAfterExecute
	}
public function execute ( ) { // @event onBeforeExecute // Enable basic garbage collection. gc_enable ( ) ; $ this -> getLogger ( ) -> info ( 'Starting ' . $ this -> name ) ; // Set off the process for becoming a daemon. if ( $ this -> daemonize ( ) ) { // Declare ticks to start signal monitoring. When you declare ticks, PCNTL will monitor // incoming signals after each tick and call the relevant signal handler automatically. declare ( ticks = 1 ) ; // Start the main execution loop. while ( true ) { // Perform basic garbage collection. $ this -> gc ( ) ; // Don't completely overload the CPU. usleep ( 1000 ) ; // Execute the main application logic. $ this -> doExecute ( ) ; } } else // We were not able to daemonize the application so log the failure and die gracefully. { $ this -> getLogger ( ) -> info ( 'Starting ' . $ this -> name . ' failed' ) ; } // @event onAfterExecute }
Execute the daemon.

@return  void

@since   1.0
Execute the daemon .