HI All,
So I've solved the issue with sessions and it appears as though it is mucking up the delayed subroutine and I've written a test case based on the example in the docs and I'm surely missing something as it doesn't work properly, since it blocks.
Here is a simple case of delayed blocking, I've moved the session code outside the subroutine which now does return.
get '/Load/:ID' => sub {
my $ID = params->{'ID'};
my $Username = "Test";
session 'Username' => $Username;
delayed {
my $TextToWrite = ReturnText();
sleep(10); # Do something that takes a few seconds
content "$TextToWrite";
done;
};
};
at the "sleep" function, the application basically stops, waiting for sleep to complete.
The docs confused me as well, it says:
content 'Hello, again!';
# when done, close the connection
done;
# do whatever you want else, asynchronously
# the user socket closed by now
...
};
};
At the end it talks about doing stuff asynchronously, implying that
whatever was done previously was not asynchronous?
So yeah, some clarification would be awesome, or just someone with an example which works.
David