| 1 | 1 | ▶ | use strictures 2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Dancer2::Plugin::Shutdown; | ||
| 4 | |||
| 5 | # ABSTRACT: Graceful shutdown your Dancer2 application | ||
| 6 | |||
| 7 | 1 | ▶ | use Dancer2::Plugin; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | with 'Dancer2::Plugin::Role::Shutdown'; | |
| 10 | |||
| 11 | 1 | our $VERSION = '0.002'; # VERSION | |
| 12 | |||
| 13 | 1 | ▶ | on_plugin_import { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | 1 | my $self = shift; | |
| 15 | $self->app->add_hook( | ||
| 16 | Dancer2::Core::Hook->new( | ||
| 17 | name => 'before', | ||
| 18 | 7 | ▶ | code => sub { $self->before_hook(@_) }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 19 | ) | ||
| 20 | 1 | ); | |
| 21 | 1 | }; | |
| 22 | |||
| 23 | |||
| 24 | 1 | register shutdown_at => \&_shutdown_at; | |
| 25 | |||
| 26 | |||
| 27 | 0 | ▶ | register shutdown_session_validator => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 28 | 0 | shift->validator(@_) | |
| 29 | 1 | }, { is_global => 1 }; | |
| 30 | |||
| 31 | 1 | register_plugin; | |
| 32 | |||
| 33 | 1 | 1; | |
| 34 | |||
| 35 | __END__ | ||