Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

MooseX::Storage and HTTP::Session ... are they friends?

by sundialsvc4 (Abbot)
on Nov 30, 2011 at 13:16 UTC ( #940839=perlquestion: print w/ replies, xml ) Need Help??
sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:

I suppose that I am still accustomed to the Mojolicious framework, but my question is this ... if I include a Moose object into an HTTP::Session stash, and that object uses MooseX::Storage, do in fact the “Storage” bits get called, or is the object “merely” going to be treated as a hash?   To put it another way, are there certain stashing interfaces that are “MooseX::Storage aware” whereas others are not?   If not, what is required?

Comment on MooseX::Storage and HTTP::Session ... are they friends?
Re: MooseX::Storage and HTTP::Session ... are they friends?
by stvn (Monsignor) on Nov 30, 2011 at 17:27 UTC

    MooseX::Storage is no more magic then Moose is, if you want your MooseX::Storage enabled object to be turned into a HASH ref, you just need to call the pack method on it. And to restore it from a HASH ref you call the unpack method.

    As for using it with HTTP::Session, you likely just want to wrap HTTP::Session and either override the get/set methods to watch for any MooseX::Storage enabled objects, or have a special {get,set}_moose_object method that handles things for you.

    -stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://940839]
Approved by keszler
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-10-20 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (88 votes), past polls