confess "ERROR NBI::Queue: jobid must be an integer\n"if(defined$new_val&& $new_val!~ /^\d+$/);
$self->{jobid} = $new_valif(defined$new_val);
return$self->{jobid};
}
substatus : lvalue {
# Update status
my($self, $new_val) = @_;
confess "ERROR NBI::Queue: status must be one of the following values: $VALID_STATUS_STR\n"if(defined$new_val&& !grep{$_eq uc($new_val)} @VALID_STATUS);
$self->{status} = $new_valif(defined$new_val);
return$self->{status};
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
NBI::QueuedJob - NBI::QueuedJob, to describe a job from the SLURM queue (squeue)
=head1 VERSION
version 0.11.0
=head1 SYNOPSIS
use NBI::QueuedJob;
# Create a new QueuedJob object
my $job = NBI::QueuedJob->new(
-user => 'username',
-jobid => 12345,
-queue => 'queue_name',
-status => 'RUNNING',
-name => 'job_name',
-attr1 => 'value1',
-attr2 => 'value2',
);
# Access and modify object attributes
$job->username = 'new_username';
$job->status = 'COMPLETED';
# Get attribute values
my $jobid = $job->jobid;
my $status = $job->status;
=head1 DESCRIPTION
The C<NBI::QueuedJob> module provides a representation of a job from the SLURM queue (squeue).
It allows you to create job objects and access their attributes.
It is used by L<NBI::Queue> to describe the jobs in the queue.
=head1 METHODS
=head2 new
my $job = NBI::QueuedJob->new(%options);
Creates a new C<NBI::QueuedJob> object with the specified options.
The options should be provided as a hash, using the following keys:
=over 4
=item C<-user>
The username associated with the job.
=item C<-jobid>
The job ID.
=item C<-queue>
The name of the queue in which the job is running.
=item C<-status>
The status of the job.
=item C<-name>
The name of the job (pattern)
=back
=head2 username
$job->username = 'new_username';
my $username = $job->username;
Accessor for the C<username> attribute of the job.
=head2 jobid
$job->jobid = 54321;
my $jobid = $job->jobid;
Accessor for the C<jobid> attribute of the job.
=head2 queue
$job->queue = 'new_queue';
my $queue = $job->queue;
Accessor for the C<queue> attribute of the job.
=head2 status
$job->status = 'COMPLETED';
my $status = $job->status;
Accessor for the C<status> attribute of the job.
=head2 name
$job->name = 'new_name';
my $name = $job->name;
Accessor for the C<name> attribute of the job.
=head1 AUTHOR
Andrea Telatin <proch@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2023-2025 by Andrea Telatin.
This is free software, licensed under:
The MIT (X11) License
=cut
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)