可观察对象必须: 断言它有#changed 调用#notify_observers 观察者使用#add_observer订阅更新,它还指定通过notify_observers调用的方法。
公共实例方法 notify_observers(*arg)Showsource 通知观察者状态的变化。
multicastedtoeachsubscriberlettimeoutId; //Returnthesubscriberfunction(runswhensubscribe()//functionisinvoked)return(observer)=>{observers.push
const_iteratorfirst,const_iteratorlast);voidswap(set<Key,Compare,Allocator>&);voidclear()noexcept;//observers
const_iteratorfirst,const_iteratorlast);voidswap(map<Key,T,Compare,Allocator>&);voidclear()noexcept;//observers
>&abs_time);voidunlock();//modifiers:voidswap(unique_lock&u)noexcept;mutex_type*release()noexcept;//observers
phpusePHPUnit\Framework\TestCase;classSubject{protected$observers=[];protected$name;publicfunction__construct