This file contains hidden or 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 MySQL::Partition::Definition; | |
| use strict; | |
| use warnings; | |
| use parent qw(Class::Accessor::Fast); | |
| use Data::Util qw(is_array_ref is_scalar_ref is_integer is_number is_value); | |
| use DBI qw(:sql_types); | |
| our $VERSION = '0.01'; |
This file contains hidden or 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 Test::More; | |
| use Test::SharedFork; | |
| use Parallel::Prefork; | |
| use IO::Pipe; | |
| my $pm = Parallel::Prefork->new(+{ | |
| max_workers => 3, |
This file contains hidden or 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 select_query { | |
| my ($self, $table, $fields, $where, $opt) = @_; | |
| unless (ref $fields eq 'ARRAY') { | |
| Carp::croak("SQL::Maker::select_query: \$fields should be ArrayRef[Str]"); | |
| } | |
| my $stmt = $self->new_select( | |
| select => $fields, | |
| ); |
This file contains hidden or 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 warnings; | |
| use FindBin; | |
| use lib "$FindBin::Bin/../lib"; | |
| use Getopt::Long; | |
| use IO::Socket::INET; | |
| use IO::Poll; | |
| use Log::Minimal; |
This file contains hidden or 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 warnings; | |
| use AnyEvent; | |
| use AnyEvent::Handle; | |
| use AnyEvent::Socket; | |
| use Data::Dump qw(dump); |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <hiredis/hiredis.h> | |
| /** | |
| * gcc -I/usr/local/include -L/usr/local/lib -lhiredis -Wall -o connect connect.c | |
| */ | |
| void redisDisconnect(redisContext *ctx) { |
This file contains hidden or 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 warnings; | |
| use AnyEvent; | |
| my $cv = AnyEvent->condvar; | |
| for my $i (1..10) { | |
| $cv->begin; |
This file contains hidden or 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
| MYSQL_BUILD_DIR = | |
| MYSQL_PLUGIN_DIR = | |
| CC := gcc | |
| CPPFLAGS := -Iinclude -I$(MYSQL_BUILD_DIR)/include -dynamiclib | |
| LIB_FILE := lib_mysqludf_calc_distance.dylib | |
| VPATH := src include | |
| all: lib_mysqludf_calc_distance.dylib | |
| lib_mysqludf_calc_distance.dylib: src/lib_mysqludf_calc_distance.c include/lib_mysqludf_calc_distance.h | |
| $(CC) $(CPPFLAGS) -o $@ src/lib_mysqludf_calc_distance.c |
This file contains hidden or 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 warnings; | |
| use Data::Dump qw(dump); | |
| use Parallel::ForkManager 0.7.6; | |
| my @servers = map { sprintf("svr%03d", $_) } (1 .. 1000); | |
| my %results; |
This file contains hidden or 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 warnings; | |
| use Data::Dump qw(dump); | |
| use IO::Pipe; | |
| use Parallel::Prefork; | |
| use Time::HiRes; |