$buffer */ public function __construct( private \ThreadedArray $buffer, private SleeperNotifier $notifier ){} public function write(string $str) : void{ $this->buffer[] = $str; $this->notifier->wakeupSleeper(); } }