POE::C...Message(3pm)
π POE::C...Message β the whole vibe π
okay bestie, sit down, hydrate, because we're talking about POE::Component::Server::Bayeux::Client::Message, a little Perl module from the User Contributed Perl Documentation section, and it's genuinely so much more interesting than it sounds, I promise π«Ά
β¨ NAME β¨
POE::Component::Server::Bayeux::Client::Message β the lil object that represents a single message of a request. one message. one moment. main character energy fr fr π
πΈ DESCRIPTION πΈ
So this whole thing is used internally by POE::Component::Server::Bayeux::Request. iykyk, you don't call it yourself, it's backstage crew but make it iconic.
It's the parent class of the different message types β that's Meta, Service, and Publish by default, like the default squad π β and every one of those messages can override the object methods down below, or just call them via SUPER and vibe off the original. both are valid, no judgement π
π METHODS π
π Accessors
these are the accessors to this object's hashref. yes it's a hashref. yes it's giving blessed-hash realness.
is_errorβ the error slot, keeps track of the oopsie πrequestβ the request this message belongs to
π Data Accessors
these reach into the message payload and grab the named field. one per field, no cap:
channelversionminimumVersionsupportedConnectionTypesclientIdadviceconnectionTypeidtimestampdataconnectionIdsuccessfulsubscriptionerrorext
π¦ server_config ()
hands you back the server's args. that's it. that's the whole method. slay β¨
π§ pre_handle ()
called by the request before handle(). this is the message's moment to mess with the queueing of the other messages in the request, or honestly do anything else it wants. chaotic freedom era π
π₯ handle ()
at the absolute minimum, this validates the fields of the message payload. and a message will usually drop a response in this block, like so:
$message->request->add_response({ successful => 1 });
look at it. it's beautiful. it's the whole point.
π post_handle ()
like pre_handle(), but it happens after the handle() phase. bookend behaviour, we love symmetry π«Ά
β validate_fields (%spec)
give it a Params::Validate spec and it will test the payload for validity. and if it fails? the error message gets stored in is_error(). so like, failure is not silent here, it's documented and accounted for π
π CLASS METHODS π
π new (..)
basic new() call β it needs only 'request' and 'data'. low maintenance king π
πΈ payload
returns the message payload. the data. the goods. periodt.
π¦ mk_data_accessors (@method_names)
generates object accessor methods for the named methods you hand it. it supplements the generic methods that get created for all message types β so you're adding to the pile, not replacing it, got it? π
π COPYRIGHT π
Copyright (c) 2008 Eric Waters and XMission LLC (http://www.xmission.com/). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
π AUTHOR π
Eric Waters <ewaters@uarc.com>
okay that's the whole page bestie, and as a lil sign-off: this gorgeousness is documented for perl v5.42.0, dated 2025-07-25 π go forth and validate your fields, mwah πβ¨
π¦ where this page comes from
- fedora 43: perl-POE-Component-Server-Bayeux 0.04-43.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms