| 1 | package Promise::ES6::Event::MojoIOLoop; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | #---------------------------------------------------------------------- | ||
| 7 | |||
| 8 | use Mojo::IOLoop (); | ||
| 9 | |||
| 10 | BEGIN { | ||
| 11 | if (!Mojo::IOLoop->can('next_tick')) { | ||
| 12 | die( __PACKAGE__ . " requires Mojo::IOLoop::next_tick(). Upgrade to a newer Mojolicious version.$/" ); | ||
| 13 | } | ||
| 14 | } | ||
| 15 | |||
| 16 | #---------------------------------------------------------------------- | ||
| 17 | |||
| 18 | sub __postpone { | ||
| 19 | Mojo::IOLoop->next_tick($_[0]); | ||
| 20 | } | ||
| 21 | |||
| 22 | use constant get_postpone => \&__postpone; | ||
| 23 | |||
| 24 | 1; |