Example #1
0
 /**
  * @param string                 $socketAddress
  * @param WorkerBootstrapProfile $bootstrapProfile
  * @param string|null            $implementationClassName
  * @param bool                   $autoStart
  *
  * @throws Exception\ConnectException
  *
  * @return static
  */
 public static function withClass($socketAddress, WorkerBootstrapProfile $bootstrapProfile, $implementationClassName = null, $autoStart = true)
 {
     return new static($socketAddress, $bootstrapProfile, $implementationClassName === null ? null : $bootstrapProfile->generateExpression($implementationClassName), $autoStart);
 }
Example #2
0
 /**
  * @param WorkerBootstrapProfile $bootstrapProfile
  * @param string                 $implementationClassName
  * @param int|null               $workerCount
  *
  * @throws Exception\InvalidArgumentException
  * @throws Exception\RuntimeException
  *
  * @return static
  */
 public static function withClass(WorkerBootstrapProfile $bootstrapProfile, $implementationClassName, $workerCount = null)
 {
     return new static($bootstrapProfile, $bootstrapProfile->generateExpression($implementationClassName), $workerCount);
 }