Skip to content

Instantly share code, notes, and snippets.

/test.pl Secret

Created December 7, 2015 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7141e19cc58364bf01ed to your computer and use it in GitHub Desktop.
Save anonymous/7141e19cc58364bf01ed to your computer and use it in GitHub Desktop.
use Mojo::Pg;
use Mojolicious::Lite;
my $pg = Mojo::Pg->new('postgresql://tester:testing@/test');
Mojo::IOLoop->next_tick(sub {
$pg->pubsub->listen(test => sub {
my ($pubsub, $payload) = @_;
app->log->debug("TEST: $payload");
});
});
Mojo::IOLoop->recurring(3 => sub {
$pg->pubsub->notify(test => time);
});
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment