public function __construct($cb) { $this->state = self::STATE_WAITING; $this->producer = $cb; $this->listeners = new StackCallbacks(); }