Re: [Mojolicious] Please give me less trivial example of non-blocking Mojo::UserAgent

2016-11-12 Thread Alexbyk (subscriptions)
Here is how you can fetch simultaneously many urls, check if every response is 200 OK and print title tags (or catch an exception if something goes wrong) . If you're not familiar with promises, here is a perfect documentation

Re: [Mojolicious] Re: Please give me less trivial example of non-blocking Mojo::UserAgent

2016-11-16 Thread Alexbyk (subscriptions)
You are asking too abstract question and trying to get too specific answer. If you want an example that works for you, provide a details: what sites do you want to parse, where they come from, why do you need to throttle download queue, what exactly r u trying to limit (max connections at a

Re: [Mojolicious] How to stop rendering after user error?

2016-12-01 Thread Alexbyk (subscriptions)
Actually, you're on the right way. But instead of calling render in controller (you'll get many duplicates of the same code), you better just leave only "die" there, and call render method from the hook. Smthng like this: # hook (you can also consider arount_action hook)