public function children_running($bucket = self::DEFAULT_BUCKET, $show_pending = false)
	{
		// force reaping of children
		$this->signal_handler_sigchild(SIGCHLD);

		// return global count if bucket is default
		if ($bucket == self::DEFAULT_BUCKET)
		{
			return ($show_pending ? count($this->forked_children) : $this->forked_children_count);
		}

		// count within the specified bucket
		$count = 0;
		foreach ($this->forked_children as $child)
		{
			if ($show_pending)
			{
				if ($child['bucket'] == $bucket)
				{
					$count++;
				}
			}
			else if (($child['bucket'] == $bucket) && ($child['status'] != self::STOPPED))
			{
				$count++;
			}
		}

		return $count;
	}
public function children_running($bucket = self::DEFAULT_BUCKET, $show_pending = false)
	{
		// force reaping of children
		$this->signal_handler_sigchild(SIGCHLD);

		// return global count if bucket is default
		if ($bucket == self::DEFAULT_BUCKET)
		{
			return ($show_pending ? count($this->forked_children) : $this->forked_children_count);
		}

		// count within the specified bucket
		$count = 0;
		foreach ($this->forked_children as $child)
		{
			if ($show_pending)
			{
				if ($child['bucket'] == $bucket)
				{
					$count++;
				}
			}
			else if (($child['bucket'] == $bucket) && ($child['status'] != self::STOPPED))
			{
				$count++;
			}
		}

		return $count;
	}
public function children_running ( $ bucket = self :: DEFAULT_BUCKET , $ show_pending = false ) { // force reaping of children $ this -> signal_handler_sigchild ( SIGCHLD ) ; // return global count if bucket is default if ( $ bucket == self :: DEFAULT_BUCKET ) { return ( $ show_pending ? count ( $ this -> forked_children ) : $ this -> forked_children_count ) ; } // count within the specified bucket $ count = 0 ; foreach ( $ this -> forked_children as $ child ) { if ( $ show_pending ) { if ( $ child [ 'bucket' ] == $ bucket ) { $ count ++ ; } } else if ( ( $ child [ 'bucket' ] == $ bucket ) && ( $ child [ 'status' ] != self :: STOPPED ) ) { $ count ++ ; } } return $ count ; }
Return the number of children running

@param int  $bucket       The bucket to use.
@param bool $show_pending True to show children that are done,
but not yet had their results retrieved.
@return int the number of children running
Return the number of children running