[tpm] Fwd: delimiting/reading YAML documents across sockets
mike at stok.ca
Mon Jul 8 16:15:30 PDT 2013
Forgot to reply all. Might as well be ignorant in public
Begin forwarded message:
> From: Fulko Hew <fulko.hew at gmail.com>
> Subject: [tpm] delimiting/reading YAML documents across sockets
> Date: 8 July, 2013 3:25:57 PM EDT
> To: toronto-pm at pm.org
> Here's another entry for my 'yet to be composed' meeting
> presentation entitled 'Things I've Stubbed My Toe On ...'
> I'm trying to use YAML modules to send structures across
> pipes from children to parent processes (or sockets).
> Although the YAML docs talk about Dump() and Load()
> I haven't been able to find (or figure out) an adequate
> example of 'exchanging' the data, only encoding and decoding.
> Although YAML talks about documents, and documents are delimited
> by '---' and '...' respectively, the YAML.pm doesn't (apparently)
> directly provide this kind of 'document' support. I would have
> expected a module to have provided a 'document wrapper' support.
> Although I can add the wrapper manually during transmission...
> Then when it comes to the receiving end... what am I expected
> to do? I don't think I can do a simple newline delimited read.
> [What happens to newlines that may have been in the variables
> I was YAML sending ?] Do I need to sit in a loop doing
> newline-reads, accumulating stuff, till I see a line that starts
> with the '---' or '...' ?
> And, can all variables in a single exchange be sent within
> the same document (example?) or do I have to send them
> as individual documents within some kind of 'document of
> document' wrapper? Surely this can't be as hard as it seems?
> Suggestions, examples or references ?
> [PS. The same questions would apply to anyone who suggests
> JSON as an alternative.]
> toronto-pm mailing list
> toronto-pm at pm.org
Mike Stok <mike at stok.ca>
The "`Stok' disclaimers" apply.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the toronto-pm