[Machine readable output from userland utilities] report

Zaro Korchev zkorchev at mail.bg
Wed May 28 12:06:51 UTC 2014


Le 28 May 2014 à 13:41, Vsevolod Stakhov a écrit :

> David, Zaro,
> 
> I do not understand what is streaming *output* in case of any
> serialization format. Does it means that you want to have some output on
> object changing?
> 
> This is not currently supported by libucl, but the design of ucl emitter
> allows to implement it in a rather straightforward way.

The idea is to serialize the object as it is constructed. That way it is not necessary to keep all the data in memory at any given moment. This also allows to create pipeline when the second application starts consuming output before the first one finished producing it.

for example:
object_start(buf, ...) writes to buf:
{
object_key(buf, ..., "foo") writes to buf:
"foo"
sol_object_integer(buf, ..., 42) writes to buf:
: 42
sol_object_end(buf, ...) writes to buf:
}

I hope this explains the idea clearly :)

> 
> YAJL, on the contrary, supports JSON only.

Yes, YAJL is limited to JSON. I'm currently using it but I can switch to using another library easily without changing too much code. If I can use libucl in the way similar to what I've descibed above, that will ease supporting multiple output formats.

I'm in no way in a hurry for this. Supporting formats other than JSON is not urgent.


Thank you,
Zaro


More information about the soc-status mailing list