-
-
09 Apr 2019 14:50:32 UTC
- Distribution: Stepford
- Module version: 0.006000
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (355 / 18 / 0)
- Kwalitee
Bus factor: 1- 95.98% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (56.77KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 8 contributors-
Dave Rolsky
-
Greg Oschwald
-
José Joaquín Atria
-
Kevin Phair
-
Mark Fowler
-
Olaf Alders
-
Ran Eilam
-
vti
- Dependencies
- Carp
- List::AllUtils
- Log::Dispatch
- Log::Dispatch::Null
- Module::Pluggable::Object
- Moose
- Moose::Role
- Moose::Util::TypeConstraints
- MooseX::Params::Validate
- MooseX::StrictConstructor
- MooseX::Types
- MooseX::Types::Combine
- MooseX::Types::Common::Numeric
- MooseX::Types::Common::String
- MooseX::Types::Moose
- MooseX::Types::Path::Class
- Parallel::ForkManager
- Path::Class
- Scope::Guard
- Throwable::Error
- Time::HiRes
- Try::Tiny
- namespace::autoclean
- namespace::clean
- parent
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Stepford::Role::Step::FileGenerator::Atomic - A role for steps that generate a file atomically
VERSION
version 0.006000
DESCRIPTION
This role consumes the Stepford::Role::Step::FileGenerator role. It allows only one file production, but makes sure it is written atomically - the file will not exist if the step aborts. The file will only be committed to its final destination when
run
completes successfully.Instead of manipulating the file production directly, you work with the file given by
$step->pre_commit_file
. This role will make sure it gets committed afterrun
.METHODS
This role provides the following methods:
$step->BUILD
This method adds a wrapper to the BUILD method which ensures that there is only one production.
$step->pre_commit_file
This returns a temporary file in a temporary directory that you can manipulate inside
run
. It will be removed if the step fails, or renamed to the final file production if the step succeeds.CAVEATS
When running steps in parallel, it is important to ensure that you do not call the
$step->pre_commit_file
method outside of the$step->run
method. If you call this at object creation time, this can cause the tempdir containing thepre_commit_file
file to be created and destroyed before the run method ever gets a chance to run.SUPPORT
Bugs may be submitted through https://github.com/maxmind/Stepford/issues.
AUTHOR
Dave Rolsky <drolsky@maxmind.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 - 2019 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Stepford, copy and paste the appropriate command in to your terminal.
cpanm Stepford
perl -MCPAN -e shell install Stepford
For more information on module installation, please visit the detailed CPAN module installation guide.