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 TouchBase::Schema::ResultSet::Voucher; | |
use common::sense; | |
use Moose; | |
use namespace::autoclean; | |
extends 'DBIx::Class::ResultSet'; | |
with 'TouchBase::Role::Verification'; | |
with 'TouchBase::Role::Verification::TransactionalActions::DBIC'; | |
with 'TouchBase::Schema::Role::ResultsetFind'; |
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 strict; | |
use warnings; | |
use Benchmark qw/timethese cmpthese :hireswallclock/; | |
use Redis; | |
use Redis::hiredis; | |
my $r2 = Redis->new; | |
my $r = Redis::hiredis->new(); | |
$r->connect( '127.0.0.1', 6379 ); | |
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
sub test_callback { | |
my $promise = Mojo::Promise->new(); | |
my $req = Mojo::Message::Request->new; | |
my $id = Mojo::IOLoop->server( | |
{ address => '127.0.0.1' } => sub { | |
my ( $loop, $stream ) = @_; | |
$stream->on( |
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 strict; | |
use Mojo::Promise; | |
use Mojo::IOLoop::Subprocess; | |
use Mojo::UserAgent; | |
my $subprocess = Mojo::IOLoop::Subprocess->new; | |
$subprocess->run( | |
sub { | |
my $subprocess = shift; |
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 MojoX::InsistentPromise; | |
use strict; | |
use Carp; | |
use Mojo::IOLoop; | |
use Mojo::Promise; | |
my @retry_timing = (0, 0.5, 1, 3, 7, 13, 21, 34, 55, 60, 120); | |
use Scalar::Util 'weaken'; |
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 common::sense; | |
use DDP; | |
use Mojo::Promise; | |
use Mojo::IOLoop::Subprocess; | |
use Mojo::UserAgent; | |
my $subprocess = Mojo::IOLoop::Subprocess->new; | |
$subprocess->run( | |
sub { |
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 common::sense; | |
use DDP; | |
use Mojo::Promise; | |
use Mojo::IOLoop::Subprocess; | |
my $subprocess = Mojo::IOLoop::Subprocess->new; | |
$subprocess->run( | |
sub { | |
my $subprocess = shift; |
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 common::sense; | |
use DDP; | |
use Mojo::Promise; | |
use Mojo::IOLoop::Subprocess; | |
my $subprocess = Mojo::IOLoop::Subprocess->new; | |
$subprocess->run( | |
sub { | |
my $subprocess = shift; |
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 common::sense; | |
use DDP; | |
use Mojo::Promise; | |
use Mojo::IOLoop::Subprocess; | |
my $subprocess = Mojo::IOLoop::Subprocess->new; | |
$subprocess->run( | |
sub { | |
my $subprocess = shift; |
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 MojoX::InsistentPromise; | |
use strict; | |
use Carp; | |
my @retry_pos = (0, 0.5, 1, 3, 7, 13, 21, 34, 55, 60, 120); | |
$_ = $_ / 10000 for @retry_pos; # Test only! | |
use Scalar::Util 'weaken'; | |
sub new { |