Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
Command executed through Proc::Async is not "tapped" correctly

I have a good like this... straight from the documentation

my $proc = Proc::Async.new: ‘raku’, ‘script.raku’;
$proc.stdout.tap(-> $v { print "Output: $v" }, quit => { say 'caught exception ' ~ .^name });
$proc.stderr.tap(-> $v { print "Error:  $v" });
my $promise = $proc.start;
Thread.start: {  await $promise;}
sleep 30;

The script produces data on stdout and stderr. But it only prints one line .. Output:something

It stops printing information out... The script produces much more output.. What could be the problem?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You need an await $promise at the end of your program, otherwise it might just exit before the program you call has finished running.

Update (after OP edited his post).

OP also said off stackoverflow:

The full output is printed when the program ends.. with a considerable delay.

If that's the case, the problem is likely with the program that is called, that it buffers its STDOUT (and possible STDERR), and so the observing program doesn't even have early access to its output.

Calling flush on the appropriate handle in the called program might help.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda