* @copyright 2016-2020 Daniil Gentili * @license https://opensource.org/licenses/MIT MIT */ namespace danog; /** * Blocking wakeup trait. * * Manages blocking wakeup of async classes * * @author Daniil Gentili */ trait BlockingWakeup { use AsyncWakeup; /** * Wakeup function. */ public function __wakeup(): void { if (\method_exists($this, '__wakeup_async')) { $this->setWakeupPromise($this->__wakeup_async()); } $this->wakeup(); } }