-
-
Save ology/7736168e05258e7b5fcd634454f568f0 to your computer and use it in GitHub Desktop.
IO::Async::Process exit code 256? Why?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use v5.36; | |
| use IO::Async::Loop (); | |
| use IO::Async::Process (); | |
| use IO::Async::Timer::Periodic (); | |
| my $loop = IO::Async::Loop->new; | |
| my $timer = IO::Async::Timer::Periodic->new( | |
| interval => 1, | |
| on_tick => sub { | |
| say "You've had 1 second (" . time() . ')'; | |
| my $proc = IO::Async::Process->new( | |
| code => sub { say 'Hello?' }, | |
| on_finish => sub { | |
| my ( $self, $exitcode ) = @_; | |
| print "Process finished with code $exitcode\n"; | |
| }, | |
| ); | |
| $loop->add($proc); | |
| }, | |
| ); | |
| $loop->add($timer); | |
| $timer->start; | |
| $loop->run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment