GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Pipeline::Segment::Async(3) User Contributed Perl Documentation Pipeline::Segment::Async(3)

Pipeline::Segment::Async - asynchronous pipeline segments

  my $seg = $pipe->store->get( $async_segment_classname );
  my $ret = $seg->reattach();

The "Pipeline::Segment::Async" module allows you to write asynchronous pipeline segments. Whenever an asynchronous segment is dispatched it places itself in the store, and splits away from the main process that keeps running. At any point furthe down the pipeline you can request the segment from the store, and then ask it to give you back its return values by calling the "reattach()" method, or even, throw them away by calling "discard()" which will simply destroy the segment when it completes. If you call "discard()" there is no way you can get it back.

You add any asynchronous segment to the a pipeline in exactly the same manner you would add any other segment. It gets dispatched in the normal way, with the normal arguments supplied to the dispatch method. Getting objects from the store will retrieve them as expected. however altering those objects or setting them back into the store will not do what you expect.

"Pipeline::Segment::Async" works by indicating to the dispatcher that it wants a different method to be its dispatch method. If you indicate to the dispatcher that you want something to dispatch different at the segment level, then your asynchronous segment will be come decidedly synchronous.

"Pipeline::Segment::Async" inherits from "Pipeline::Base" and has any methods that it provides.

init()
"init()" is called by the constructor, and sets up the list of threading models that "Pipeline::Segment::Async" is aware of. See "threading_models()" for more information.
threading_models( [ARRAYREF] )
"threading_models()" gets and sets a list of classes that know how to process segements asynchronously.
predispatch()
"predispatch()" is called by the pipeline dispatcher and prepares the segment for asynchronous execution.
model( [Pipeline::Segment::Async::*] )
"model()" returns an object that represents the threading model that "Pipeline::Segment::Async" will call. If it does not yet have an object a call to "determine_threading_model()" is called.
determine_threading_model()
"determine_threading_model()" will look at all the classes in the list provided by "threading_models()" and determine if they can operate under the current configuration. It will return an object of one of those classes, provided it can operate.
reattach()
"reattach()" takes a detached asynchronous segment and joins it back, placing the results in the correct area of the pipeline.
discard()
"discard()" flags an asynchronous segment as never needing to be reattached.
dispatch_method()
"dispatch_method()" tells the pipeline dispatch class which method to call in order to dispatch this class. In the case of "Pipeline::Segment::Async" it returns a constant with the value predispatch.

Pipeline::Segment, Pipeline::Dispatch, Pipeline::Base, Pipeline::Segment::Async::Handler

James A. Duncan <jduncan@fotango.com>

Copyright 2003 Fotango Ltd. All Rights Reserved.

This software is released under the same terms as Perl itself.

2004-08-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.