Skip to content

Commit c3d223a

Browse files
committed
Fix demo that was using Timer::cancel() from old event-loop api
1 parent 5f91a62 commit c3d223a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/subscribeOn/subscribeOn.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
// Change scheduler for here
1919
$timer = $loop->addTimer(0.001, $handler);
2020

21-
return new CallbackDisposable(function () use ($timer) {
21+
return new CallbackDisposable(function () use ($loop, $timer) {
2222
// And change scheduler for here
2323
if ($timer) {
24-
$timer->cancel();
24+
$loop->cancelTimer($timer);
2525
}
2626
});
2727
});

0 commit comments

Comments
 (0)