My current Perl Ironman Challenge status is: My Ironman Badge

Monday, June 8, 2009

POEx::ProxySession is alive

So I have been putting time into my IKC-like replacement and with last nights (err, this mornings) commits, I have a working server/client setup that successfully proxies a POEx::Role::Instantiation composed class.

So like I was explaining a couple of weeks ago, I needed a simpler IKC that provided persistent local subscribed sessions that proxied posts through the server, back to the original published session. Mainly, I need Voltron to have access to these proxied sessions so that it is trivial to setup applications and to post events to them using PubSub.

Anyhow, it was an arduous task getting this thing work. There were some problems, naturally. The biggest problem was in the client. Creating a proxy session using the serialized Moose::Meta::Class was rife with issues, largely because Moose goes to great lengths to optimize it's meta internals via coderefs. And Storable+B::Deparse doesn't seem to work as advertised, especially when there are hooks introduced into the parsing process via Devel::Declare. So I couldn't count on coderefs.

So that meant after getting the deserialized Meta::Class I couldn't touch any of the methods on the object itself. But as long as I broke encapsulation on the Meta::Class (mainly via ->{methods}), I got a hold of all the meta data that I needed.

The second issue had to do with parsing method signatures and in the end it made a lot of sense once I understood what was all going on in the environment. MXD makes use of namespace::autoclean which scrubs the symbol table post intial compilation. That means that all of my imported POEx::Types were getting scrubbed away, which was a problem when I was passing method signature strings to MXMS::Meta::Method->wrap(). It couldn't find the symbols. And I chased this behavior for a while. Traced into several modules, and eventually wrote a simpler test case that would give the same result. And yes, it had to do with symbols. So I appened the "is dirty" option to the Client class and like magic things started working.

But in my symbol exploration, I discovered that POEx::Role::SessionInstantiation in during its anonymous class cloning /all/ of the symbols not native to the class were lost, which is a big problem. So that got fixed.

Beyond those problems in making several different technologies work together, the message data structure went through a couple of revisions to the point where a message identifier is now required, and result/delivery semantics correctly work. In addition, the message data structure itself is lightly checked for correctness via the subtype where clauses which means validation happens everywhere. It's pretty rockin. And, a new Role is provided to decorate methods to indicate which methods should be proxied on the subscriber side(POEx::Role::ProxyEvent).

And the one last thing that was missing was a shutdown event for POEx::Role::TCPServer and TCPClient. In the tests for those modules, I was manually clearing out the stored sockets and aliases, etc, but that wouldn't really work for the tests for PXPS. So a quick implementation and update to tests, and like magic it all works.

Unfortunately, it looks like I will be going to YAPC::NA with a vast majority of the dependencies for Voltron living only in git repos rather than on the CPAN. Which isn't so bad, but it severely limits participation from the audience when they have to basically duplicate my environment just to play with it. And it isn't an easy environment to setup considering you have to clone a number of repos, AND have Dist::Zilla installed.

For the conference, I am considering at least bundling everything up in an installation ready state and hosting the tarball. Wouldn't be a lot of work, but it adds on to everything else I still need to do. Two weeks until the conference and Voltron needs a lot of work. And, my POE::Filters talk needs a simple implementation still. I'm freaking out a little bit. Long nights/days ahead of me the next couple of weeks.

4 comments:

  1. You are a perfect example (and hence an "it") of the situation I am trying to describe. That is why perl does not amount even to "piss in the wind" despite all the endless coding.

    ReplyDelete
  2. How childish. I leave a comment on your blog basically calling you an internet kook and you don't post it, but you have enough balls to respond, not to me personally, via email, but as an unrelated comment to my blog? That is awesome. Fine, good thing I have a gist saved of my comment. I'll reproduce it here, along with a link to your mindless drivel.

    First, here is the link to the kookery: http://linux-society.blogspot.com/2009/06/open-letters-to-perl-and-linux.html

    And here was my response:
    http://gist.github.com/126779

    I have no idea what you are talking about, but it seems angsty. Let me get a couple of points straight:

    "as Perl software was not simply and practically written, and was often faulty despite a extensive testing and distribution system"

    So you decided that the CPAN sucked and so you wrote your own? What faults? What's not simple or practical to one of the largest online collections of software modules in the world that adheres to the free/open source software ideals?

    Ever heard of Not Invented Here? You suffer from that significantly.

    Then you go on to berate an open source developer because he won't recognize your unbound awesomeness and intellectual prowess. Because obviously, you have the answer to all of the projects problems.

    If you haven't figured this out yet, most FOSS projects are meritocratic. You contribute, you get more say. You, who have failed to contribute anything, approach someone who /has/ contributed significant amounts as a peer, but in his eyes, you are just another internet kook. He pointed you to some git repos and said "knock yourself out", a standard response. Much like "PATCHES WELCOME." But instead, you go on to email him more kookery. Of course he isn't going to respond. Who would? And then you use that proof to do, what, prove that you are right?

    You might as well point this letter to the US government and tell them it is proof of AREA 51 and if they don't respond, it is proof it exists! And not claiming to your level of MENSAness or anything, but a simple proofread of your "letter" would help get your message across more. Reading it was like reading a ransom note where the words are all cut out of magazines.
    --

    So yeah, I am an example, huh? I'm not the one ranting on the internets incoherently.

    ReplyDelete
  3. Well aside from the less than coherent response by the gentleman above, I think your post was great nperez. You practiced some great programming skills, and honestly, they were rather perl un-related, aside from the actual fact that you're a perl hacker programming in perl. They're used in any good programmer's daily routine, and thus show that perl allows one to program just as competantly in it as any other language. The fact you ran into some quirks and pain just gives you more research to do. Speed of development has nothing to do with the fact that you're doing this in perl, it is the nature of the message passing beast.

    Kudos to you, friend.

    ReplyDelete
  4. also, I have to say, open source is about being autonomous and getting your fingers dirty and asking questions. Not having someone hand it all over to you on a silver platter.

    ReplyDelete