Skip to content
Browse files

tweaked a few cookbook recipes

  • Loading branch information...
1 parent 51eb284 commit 51d422f102744b61be5282568bce6afa08858810 @kraih committed Feb 28, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 MANIFEST.SKIP
  2. +6 −0 lib/Mojolicious/Guides/Cookbook.pod
View
2 MANIFEST.SKIP
@@ -1,5 +1,5 @@
^\.(?!perltidyrc)
.*\.old$
+^Makefile$
^blib
^pm_to_blib
-^Makefile$
View
6 lib/Mojolicious/Guides/Cookbook.pod
@@ -243,6 +243,7 @@ You can also use the built-in web server to embed L<Mojolicious> applications
into alien environments like foreign event loops.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
use Mojo::Server::Daemon;
# Normal action
@@ -301,6 +302,7 @@ Multiple events such as parallel requests can be easily synchronized with a
L<Mojo::IOLoop> delay.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
# Search Twitter for "perl" and "python"
get '/' => sub {
@@ -336,6 +338,7 @@ for example be used to delay rendering of a response, and unlike C<sleep>,
won't block any other requests that might be processed in parallel.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
# Wait 3 seconds before rendering a response
get '/' => sub {
@@ -351,6 +354,7 @@ Recurring timers are slightly more powerful, but need to be dropped manually,
or they would just keep getting emitted.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
# Count to 5 in 1 second steps
get '/' => sub {
@@ -397,6 +401,7 @@ channels between clients and servers. Receiving messages is as easy as
subscribing to the C<message> event of the transaction.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
# Template with browser-side code
get '/' => 'index';
@@ -480,6 +485,7 @@ the advantage however is low infrastructure requirements, since it reuses the
HTTP protocol for transport.
use Mojolicious::Lite;
+ use Mojo::IOLoop;
# Template with browser-side code
get '/' => 'index';

0 comments on commit 51d422f

Please sign in to comment.
Something went wrong with that request. Please try again.