Skip to content

Commit

Permalink
show how to start the reactor in synopsis examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 25, 2012
1 parent c89b8bc commit 42919db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Mojo/IOLoop/Client.pm
Expand Up @@ -156,6 +156,9 @@ Mojo::IOLoop::Client - Non-blocking TCP client
});
$client->connect(address => 'mojolicio.us', port => 80);
# Start reactor if necessary
$client->reactor->start unless $client->reactor->is_running;
=head1 DESCRIPTION
L<Mojo::IOLoop::Client> opens TCP connections for L<Mojo::IOLoop>.
Expand Down
3 changes: 3 additions & 0 deletions lib/Mojo/IOLoop/Server.pm
Expand Up @@ -175,6 +175,9 @@ Mojo::IOLoop::Server - Non-blocking TCP server
$server->start;
$server->stop;
# Start reactor if necessary
$server->reactor->start unless $server->reactor->is_running;
=head1 DESCRIPTION
L<Mojo::IOLoop::Server> accepts TCP connections for L<Mojo::IOLoop>.
Expand Down
3 changes: 3 additions & 0 deletions lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -185,6 +185,9 @@ Mojo::IOLoop::Stream - Non-blocking I/O stream
$stream->start;
$stream->stop;
# Start reactor if necessary
$stream->reactor->start unless $stream->reactor->is_running;
=head1 DESCRIPTION
L<Mojo::IOLoop::Stream> is a container for I/O streams used by
Expand Down

0 comments on commit 42919db

Please sign in to comment.