This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$./script/app minion jobx 1853 | |
{ | |
"args" => [ | |
"/some/file" | |
], | |
"attempts" => 1, | |
"children" => [], | |
"created" => "Wed Aug 3 15:05:00 2016", | |
"delayed" => "Wed Aug 3 15:05:00 2016", | |
"finished" => "Wed Aug 3 15:05:26 2016", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl test_ordered_hash get / | |
[Fri Jun 24 11:24:01 2016] [debug] GET "/" | |
[Fri Jun 24 11:24:01 2016] [debug] Routing to a callback | |
[Fri Jun 24 11:24:01 2016] [debug] 200 OK (0.000592s, 1689.189/s) | |
{ | |
"result" : { | |
"counter" : "123" | |
}, | |
"number" : { | |
"num" : "55" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$perl t/pg_list_jobs.t | |
NOTICE: drop cascades to 6 other objects | |
DETAIL: drop cascades to table minion_test.mojo_migrations | |
drop cascades to table minion_test.minion_jobs | |
drop cascades to table minion_test.minion_workers | |
drop cascades to type minion_test.minion_state | |
drop cascades to table minion_test.minion_jobs column state | |
drop cascades to function minion_test.minion_jobs_notify_workers() | |
DBI connect('dbname=sam2_dev;host=bmipgsqld1.chmcres.cchmc.org;port=5432','srv_sam_dev',...) failed: FATAL: remaining connection slots are reserved for non-replication superuser connections at /usr/local/share/perl5/Mojo/Pg.pm line 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojo::Base -strict; | |
use Test::More; | |
use Test::Mojo; | |
my $t = Test::Mojo->new('SleepTest'); | |
$t->ua->inactivity_timeout(0); | |
for(my $i = 0; $i < 10; $i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Controller::Audio; | |
use Mojo::Base 'Mojolicious::Controller'; | |
sub save { | |
my $self = shift; | |
# get contents of the audio upload in memory | |
my $upload_audio_asset = $self->tx->req->content->asset; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $audio_asset = Mojo::Asset::File->new(path => './t/test_audio.wav'); | |
my $audio_content = $audio_asset->slurp; | |
$t = $t->post_ok('/audio' => $audio_content)->status_is(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojo::UserAgent; | |
use Mojo::JSON qw/encode_json/; | |
my $token = 'NOT_A_TOKEN'; | |
my $ws_url = 'wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?watson-token=' . $token . '&model=en-US_BroadbandModel'; | |
my $ua = Mojo::UserAgent->new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojolicious::Lite; | |
# Simple plain text response | |
get '/' => {text => 'I :hearts: Mojolicious!'}; | |
# Route associating "/time" with template in DATA section | |
get '/time' => 'clock'; | |
# Scrape information from remote sites | |
get '/title' => 'title'; |