delayed {
my $TextToWrite = ReturnText();
sleep(10); # Do something that takes a few seconds
content "$TextToWrite";
done;
};
The sleep call will always cause blocking, even a sleep(0). Likewise a flush. In the sense that there is a context switch to some other thread or process.
How are you testing whether it is blocking? Sorry, I do not know what you are trying to do.