Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
A couple of quick thoughts:
  • The problem you are addressing is in spirit very, very similar to what Expect.pm addresses. The only difference is that you are communicating over an HTTP connection, whereas Expect communicates over a pseudoterminal. But both are based on a request/reply model.
  • You describe this as "recursion", but to me it seems like that's an artifact of your implementation. You could just as well change either the description or implementation to a series of dependent request/reply transactions. (In general, it seems like the pattern is more of a graph than a tree. Any request could result in a "login timed out" reply, and the subsequent login request would be the same for a whole bunch of different original requests.) You could model it as a state machine, but I think a push-down automaton might be a better fit. Which itself makes me think of YACC -- perhaps its grammar input is a good model for a descriptive format?
  • This also reminds me of Prolog. "My whole task is complete if I add a record for X, make sure the user permissions for Y are set up correctly, and I post an update to the news feed. Adding a record for X is complete if I look up "smurf livers" as a category, and I use that category to define..." etc. Using a similar reduction model, you might be able to figure out what things can be performed in parallel, or at least give nice error output: "Task A failed because subtask c2 failed."

In reply to Re: Data driven HTTP interaction by sfink
in thread Data driven HTTP interaction by revdiablo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (8)
    As of 2014-08-21 12:18 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (134 votes), past polls