Dancer::Engine(3pm)

πŸ’– Dancer::Engine πŸ’–

okay bestie, so this is the manual page for Dancer::Engine, straight out of the User Contributed Perl Documentation section (it's a 3pm page, iykyk). Sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

Dancer::Engine β€” the base class for Dancer engines. that's it. that's the name.


🌸 VERSION 🌸

version 1.3522 β€” yes, that's the number, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

the little teaser, the vibe check, the trailer:

my $engine = Dancer::Engine->build( Serializer => 'JSON', $configuration );

that's literally the whole flex ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so Dancer has a lot of engines. Serializer engines, Template engines, Logger engines, Session handlers engines β€” the whole squad. And Dancer::Engine is the base class for all of them. every single one. periodt.

now, if you're writing an engine of a common type (like the ones I just listed above, bestie, keep up 🫢), you probably don't even wanna touch this class directly β€” you'd want to just use their base class, which in turn uses Dancer::Engine. so for example:

  • Template engines inherit from Dancer::Template::Abstract
  • Serializer engines inherit from Dancer::Serializer::Abstract

and those Abstract base classes? they're the ones inheriting from Dancer::Engine. it's giving family tree 🌳

and if a new type of Dancer engine gets created? no cap, it is best if it inherits from this class. that's the move. that's the assignment. πŸ‘‘


πŸ‘‘ ATTRIBUTES πŸ‘‘

name

The name of the engine, such as JSON, or Simple. 🏷️

type

The type of the engine, such as Serializer, or Session. 🧚


πŸ’… METHODS/SUBROUTINES πŸ’…

config

Fetches the configuration of the engine.

my $configuration = $engine->config;
⚠️ important bestie: you can only set the configuration at initialization time, not after. so decide early, no take-backs, the config is not flexible like that 😭

build

Builds and returns the engine. it's a constructor, it's a glow-up, it's iconic.

my $engine = Dancer::Engine->build( $type => $name, $config );

πŸ™ˆ AUTHOR πŸ™ˆ

Dancer Core Developers β€” the whole crew, giving main character energy, we stan 🌈


This software is copyright (c) 2010 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the vibe check, bestie β€” this page is from perl v5.40.1, dated 2026-05-05. slay, go build some engines πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from