hideoki / p5-parallel-scoreboard Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kazuho/p5-parallel-scoreboard
A scoreboard for monitoring status of many processes
This project forked from kazuho/p5-parallel-scoreboard
A scoreboard for monitoring status of many processes
NAME Parallel::Scoreboard - a scoreboard for monitoring status of many workers SYNOPSIS use Parallel::Scoreboard; my $scoreboard = Parallel::Scoreboard->new( base_dir => '/tmp/my_scoreboard' ... # in each worker process $scoreboard->update('this is my current status'); # to read status of all worker processes my $stats = $scoreboard->read_all(); for my $pid (sort { $a <=> $b } keys %$stats) { print "status for pid:$pid is: ", $stats->{$pid}, "\n"; } DESCRIPTION Parallel::Scoreboard is a pure-perl implementation of a process scoreboard. By using the module it is easy to create a monitor for many worker process, like the status module of the Apache HTTP server. Unlike other similar modules, Parallel::Scoreboard is easy to use and has no limitation on the format or the length of the statuses to be stored. Any arbitrary data (like JSON or frozen perl object) can be saved by the worker processes as their status and read from the manager process. METHODS new(%args) instantiation. Recognizes the following paramaters. The parameters can be read using the read-only accessors with the same name. base_dir => $base_dir the directory name in which the scoreboard files will be stored. The directory will be created if it does not exist already. Mandatory parameter. worker_id => sub { ... } a subref that returns the id of the worker (if omitted, the module uses $$ (process id) to distinguish between the workers) update($status) saves the status of the process read_all() reads the status of all worker processes that are alive and that have called update() more than once. Returned value is a hashref with process ids as keys and the statuses of each processes as corresponding values. cleanup() remove obsolete status files found in base_dir. The files are normally removed upon the termination of worker process, however they might be left unremoved if the worker process was killed for some reason. The detection and removal of the obsolete status files is performed by read_all() as well. SEE ALSO IPC::ScoreBoard Proc::Scoreboard AUTHOR Kazuho Oku <kazuhooku gmail.com> LICENSE This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.