Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TaskQueue: to replace TheSchwartz (#2600)
Replace TheSchwartz with a TaskQueue shim, with some plumbing for doing SQS based routing of events. This also has workers for doing our ESN pipeline.
- Loading branch information
Showing
231 changed files
with
4,003 additions
and
250 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
/var | ||
*.sw? | ||
src/proxy/proxy | ||
.vstags | ||
|
||
# Ignore SCSS cache | ||
.sass-cache | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
# | ||
# bin/worker/dw-esn-process-sub | ||
# | ||
# DW style ESN subs processor. | ||
# | ||
# Authors: | ||
# Mark Smith <mark@dreamwidth.org> | ||
# | ||
# Copyright (c) 2019 by Dreamwidth Studios, LLC. | ||
# | ||
# This program is free software; you may redistribute it and/or modify it under | ||
# the same terms as Perl itself. For a copy of the license, please reference | ||
# 'perldoc perlartistic' or 'perldoc perlgpl'. | ||
# | ||
|
||
use strict; | ||
BEGIN { | ||
require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; | ||
} | ||
|
||
use DW::TaskQueue; | ||
my $q = DW::TaskQueue->init( %LJ::SQS ); | ||
$q->start_work( 'DW::Task::ESN::FindSubsByCluster' ); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
# | ||
# bin/worker/dw-esn-process-sub | ||
# | ||
# DW style ESN subs processor. | ||
# | ||
# Authors: | ||
# Mark Smith <mark@dreamwidth.org> | ||
# | ||
# Copyright (c) 2019 by Dreamwidth Studios, LLC. | ||
# | ||
# This program is free software; you may redistribute it and/or modify it under | ||
# the same terms as Perl itself. For a copy of the license, please reference | ||
# 'perldoc perlartistic' or 'perldoc perlgpl'. | ||
# | ||
|
||
use strict; | ||
BEGIN { | ||
require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; | ||
} | ||
|
||
use DW::TaskQueue; | ||
my $q = DW::TaskQueue->init( %LJ::SQS ); | ||
$q->start_work( 'DW::Task::ESN::FilterSubs' ); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
# | ||
# bin/worker/dw-esn-process-sub | ||
# | ||
# DW style ESN subs processor. | ||
# | ||
# Authors: | ||
# Mark Smith <mark@dreamwidth.org> | ||
# | ||
# Copyright (c) 2019 by Dreamwidth Studios, LLC. | ||
# | ||
# This program is free software; you may redistribute it and/or modify it under | ||
# the same terms as Perl itself. For a copy of the license, please reference | ||
# 'perldoc perlartistic' or 'perldoc perlgpl'. | ||
# | ||
|
||
use strict; | ||
BEGIN { | ||
require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; | ||
} | ||
|
||
use DW::TaskQueue; | ||
my $q = DW::TaskQueue->init( %LJ::SQS ); | ||
$q->start_work( 'DW::Task::ESN::FiredEvent' ); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
# | ||
# bin/worker/dw-esn-process-sub | ||
# | ||
# DW style ESN subs processor. | ||
# | ||
# Authors: | ||
# Mark Smith <mark@dreamwidth.org> | ||
# | ||
# Copyright (c) 2019 by Dreamwidth Studios, LLC. | ||
# | ||
# This program is free software; you may redistribute it and/or modify it under | ||
# the same terms as Perl itself. For a copy of the license, please reference | ||
# 'perldoc perlartistic' or 'perldoc perlgpl'. | ||
# | ||
|
||
use strict; | ||
BEGIN { | ||
require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; | ||
} | ||
|
||
use DW::TaskQueue; | ||
my $q = DW::TaskQueue->init( %LJ::SQS ); | ||
$q->start_work( 'DW::Task::ESN::ProcessSub' ); |
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/perl | ||
# | ||
# DW::Task | ||
# | ||
# Base class for asynchronously executed tasks. | ||
# | ||
# Authors: | ||
# Mark Smith <mark@dreamwidth.org> | ||
# | ||
# Copyright (c) 2019 by Dreamwidth Studios, LLC. | ||
# | ||
# This program is free software; you may redistribute it and/or modify it under | ||
# the same terms as Perl itself. For a copy of the license, please reference | ||
# 'perldoc perlartistic' or 'perldoc perlgpl'. | ||
# | ||
|
||
package DW::Task; | ||
|
||
use strict; | ||
use v5.10; | ||
use Log::Log4perl; | ||
my $log = Log::Log4perl->get_logger(__PACKAGE__); | ||
|
||
use constant COMPLETED => 100; | ||
use constant FAILED => 101; | ||
|
||
sub new { | ||
my ( $class, @args ) = @_; | ||
|
||
my $self = { args => \@args, }; | ||
return bless $self, $class; | ||
} | ||
|
||
sub args { | ||
my $self = $_[0]; | ||
|
||
return $self->{args}; | ||
} | ||
|
||
1; |
Oops, something went wrong.