Debian Codegraph @

t/integration/resource_timeout/StalledResource.pm

raw
1 package StalledResource;
2 use strict;
3 use warnings;
4
5 use parent 'Test2::Harness::Runner::Resource';
6
7 sub available {
8 my $self = shift;
9 my ($task) = @_;
10
11 # Allow the first task through, block everything after
12 return 0 if $self->{_started};
13 return 1;
14 }
15
16 sub assign {
17 my $self = shift;
18 my ($task, $state) = @_;
19 $state->{record} = 1;
20 }
21
22 sub record {
23 my $self = shift;
24 my ($job_id, $val) = @_;
25 $self->{_started}++;
26 }
27
28 sub release {
29 my $self = shift;
30 my ($job_id) = @_;
31 }
32
33 1;