Pipeline::Segment(3)

πŸ“¦
version 3.12 Β· 2 versions
, in fedora 43

πŸ’– Pipeline::Segment πŸ’–

okay so this is Pipeline::Segment(3), from the User Contributed Perl Documentation section of your man pages, and bestie it is so foundational. let's get into it πŸ¦‹


✨ NAME ✨

Pipeline::Segment β€” the basic class for a segment, fr fr πŸ’…


🌸 SYNOPSIS 🌸

use Pipeline::Segment;
my $ps = Pipeline::Segment->new();
$ps->dispatch();

like. that's it. that's the whole vibe check. ✨


πŸŽ€ DESCRIPTION πŸŽ€

so Pipeline::Segment is literally designed as a part of the Pipeline system β€” it's one lil piece of the whole machine, no cap. and the main character energy here is that the Pipeline::Segment class is designed to be subclassed as a part of the Pipeline system. you're not really meant to just... use it raw like that. you're meant to build on top of it. periodt. πŸ‘‘

the primary method that needs to be overloaded is the dispatch method β€” that's the one the Pipeline class uses to enter each individual segment that it contains. so like, the pipeline is walking down the row of segments and going "hey, you, do your thing" and dispatch is the thing. that's the whole door. πŸšͺ✨


🧚 METHODS 🧚

the Pipeline::Segment class inherits from Pipeline::Base, which means it also has any additional methods that its superclass may have. so if you're looking for a method and it's not here... check the parent. iykyk. πŸ’œ

  • init() β€” this one gets called at construction time, like right when the object is being born 🐣. any arguments you pass to the new method get passed straight to it.
  • dispatch() β€” this is the one. it causes the segment to perform its action. this is the method you're supposed to overload in your subclass. no pressure bestie, only all of it πŸ’…
  • dispatch_method() β€” this one gets and sets the method that gets called on dispatch. and by default, that's the dispatch() method. so yeah, it's the method that picks the method. method-ception. πŸŒ€
  • cleanup_dispatch() β€” okay so this one does post-processing on the segment to make sure no nasty circular references are lying around πŸ‘€ (those little gremlins will absolutely wreck your memory if you let them). it also disconnects various objects that are only useful during a dispatch. so basically: the after-party cleanup crew. 🧹✨
  • store() β€” gets the current store. that's it, that's the whole thing. πŸ›οΈ
  • parent() β€” returns the pipeline that the segment is currently operating from. and heads up: it gets set at dispatch time by the calling pipeline, so it's not just sitting there from the jump β€” the pipeline comes along and assigns it. 🫢

πŸ”₯ SEE ALSO πŸ”₯

  • Pipeline
  • Pipeline::Segment::Async

πŸ‘‘ AUTHOR πŸ‘‘

James A. Duncan <jduncan@fotango.com> β€” absolute legend, we stan πŸ«‘πŸ’–


Copyright 2003 Fotango Ltd. All Rights Reserved.

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


lowkey important reminder bestie: this is documentation for Pipeline::Segment(3) and it's part of the User Contributed Perl Documentation collection, so if you're out here writing your own subclass, please actually read the Pipeline::Base docs too. the inherited methods are real and they matter. πŸ’€πŸ™ˆ

and that's the page, babe! 🌸 this was perl v5.42.0, dated 2025-07-25, and it's Pipeline::Segment(3) all day every day. go forth and subclass responsibly πŸ¦‹πŸ’œπŸŽ€

πŸ“¦ where this page comes from