Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Jun 21, 2017
1 parent 51d10f5 commit 0dbc3bb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion ex/mojo_pg_chat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
$c->pg->pubsub->listen(mojochat => $cb);

# Remove callback from PG listeners on close
$c->on(finish => sub ($c, @) { $c->pg->pubsub->unlisten(mojochat => $cb) });
$c->on(finish => sub ($c, @) {
$c->pg->pubsub->unlisten(mojochat => $cb);
});
};
# reveal end websocket

Expand Down
6 changes: 5 additions & 1 deletion ex/vue_chat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
# Forward messages from PostgreSQL to the browser
my $cb = sub ($pubsub, $message) { $c->send($message) };
$c->pg->pubsub->listen(mojochat => $cb);
$c->on(finish => sub ($c, @) { $c->pg->pubsub->unlisten(mojochat => $cb) });

# Remove callback from PG listeners on close
$c->on(finish => sub ($c, @) {
$c->pg->pubsub->unlisten(mojochat => $cb);
});
};

app->start;
Expand Down
6 changes: 5 additions & 1 deletion ex/vue_chat_comp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
# Forward messages from PostgreSQL to the browser
my $cb = sub ($pubsub, $message) { $c->send($message) };
$c->pg->pubsub->listen(mojochat => $cb);
$c->on(finish => sub ($c, @) { $c->pg->pubsub->unlisten(mojochat => $cb) });

# Remove callback from PG listeners on close
$c->on(finish => sub ($c, @) {
$c->pg->pubsub->unlisten(mojochat => $cb);
});
};

app->start;
Expand Down
6 changes: 5 additions & 1 deletion ex/vue_chat_user.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
# Forward messages from PostgreSQL to the browser
my $cb = sub ($pubsub, $message) { $c->send($message) };
$c->pg->pubsub->listen(mojochat => $cb);
$c->on(finish => sub ($c, @) { $c->pg->pubsub->unlisten(mojochat => $cb) });

# Remove callback from PG listeners on close
$c->on(finish => sub ($c, @) {
$c->pg->pubsub->unlisten(mojochat => $cb);
});
};

app->start;
Expand Down
6 changes: 3 additions & 3 deletions templates/presentation.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
<li>Batteries included</li>
<li>Real-time and non-blocking</li>
<li>Native Websocket integration</li>
<li>8669 lines of code in lib</li>
<li>11507 tests (93.5% coverage)</li>
<li>8711 lines of code in lib</li>
<li>11512 tests (94.1% coverage)</li>
<li>Easy to install (secure, only takes one minute!)</li>
</ul>
<pre><code class="bash">curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious</code></pre>
Expand Down Expand Up @@ -246,7 +246,7 @@
</section>

<section>
<p>That's 45 lines</p>
<p>That's 47 lines</p>
<p>(generated using David A. Wheeler's 'SLOCCount')</p>
</section>

Expand Down

0 comments on commit 0dbc3bb

Please sign in to comment.