Main > Programming > Libraries >

Sub::Slice::Manual 1.048

Sub::Slice::Manual 1.048

Sponsored Links

Sub::Slice::Manual 1.048 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.027 MB
Platform: Any Platform
License: Perl Artistic License
Price:
Downloads: 1133
Date added: 2006-09-18
Publisher: John Alden

Sub::Slice::Manual 1.048 description

Sub::Slice::Manual is a Perl module with user guide for Sub::Slice.

USING Sub::Slice

Sub::Slice is a way of breaking down a long-running process and maintaining state across a stateless protocol. This allows the client to draw a progress bar or abort the process part-way through.

The mechanism used by Sub::Slice is similar to the session management used on many web user authentication systems. However rather than simply passing an ID back as a token as these systems do, in Sub::Slice a data structure with richer information is passed to the client, allowing the client to make some intelligent decisions rather than blindly maintain state.

Use of Sub::Slice is best explained with a minimal example. Assume that there is a remoting protocol between the client and server such as XML/HTTP. For the sake of brevity, assume that methods called in package Server:: on the client are magically remoted to the server.

The server does two things. The first is to issue a token for the client to use:

#Server
sub create_token {
my $job = new Sub::Slice();
return $job->token;
}
The second is to provide the routine into which the token is passed for each iteration:
sub do_work {
my $token = shift;
my $job = new Sub::Slice(token => $token);

at_start $job sub {
my $files = files_to_process();

#Store some data defining the work to do
$job->store("files", $files);
};

at_stage $job "each_iteration" sub {

#Get some work
my $files = $job->fetch("files");
my $file = shift @$files;

my $was_ok = process_file($file);

#Record we did the work
$job->store("files", $files);

#Check if theres any more work left to do
$job->done() unless(@$files);

};
}

The client somehow gets a token back from the server. It then passes this back to the server for each iteration. It can inspect the token to check if there is any more work left.

#Client
my $token = Server::create_token();
for(1 .. MAX_ITERATIONS) {
Server::do_work($token);
last if $token->{done};
}

Sub::Slice::Manual 1.048 Screenshot

Advertisements

Sub::Slice::Manual 1.048 Keywords

Bookmark Sub::Slice::Manual 1.048

Hyperlink code:
Link for forum:

Sub::Slice::Manual 1.048 Copyright

WareSeeker periodically updates pricing and software information of Sub::Slice::Manual 1.048 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Sub::Slice::Manual 1.048 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Shohei is a multi-language, multi-function, multi-server, multi-user, multi-context, multi-media web-based mail client. Free Download
TookieMail is a webmail client. Free Download
Simply and powerful software solution for sharing and accessing USB devices over local network or Internet! USB Server for Linux allows to work with the remote USB devices as if they are physically plugged into your computer! Free Download
Lin-setibuf Modules are a set of Perl modules for manipulating both the SETI@Home client files, and the SETI@Home text client. Free Download
A multifunctional and platform independent web based mysql administration tool Free Download
GNU Thales provides an IRC-to-MySQL gateway. Free Download
AXIGEN is a fast, reliable and secure mail server. Free Download
Cerise is a Ruby web/application server. Free Download