4 * Deferrable Update for closure/callback
6 class MWCallableUpdate
implements DeferrableUpdate
{
8 * @var Closure|callable
13 * @param callable $callback
16 public function __construct( $callback ) {
17 if ( !is_callable( $callback ) ) {
18 throw new MWException( 'Not a valid callback/closure!' );
20 $this->callback
= $callback;
26 public function doUpdate() {
27 call_user_func( $this->callback
);