public function addRunnable(Runnable $runnable)
 {
     if (!$runnable->isValid()) {
         throw new \RuntimeException("Runnable is invalid");
     }
     $this->runnables[$runnable->getId()] = $runnable;
 }
Example #2
0
 public function init(Context $context)
 {
     if ($this->inited) {
         throw new \RuntimeException("Already initialized");
     }
     $this->inited = true;
     $this->context = $context;
     parent::__construct($context, getNextGlobalId());
 }
 /**
  * @param string $mainRef
  */
 public function __construct($mainRef)
 {
     parent::__construct(new Context($mainRef), getNextGlobalId());
     $_SESSION["executors"][$this->getId()] = $this;
 }