Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2014 15:06:46 +0300
From:      Zaro Korchev <zkorchev@mail.bg>
To:        Vsevolod Stakhov <vsevolod@FreeBSD.org>
Cc:        Pawel Jakub Dawidek <pjd@freebsd.org>, soc-status@freebsd.org, Eitan Adler <eadler@FreeBSD.org>, David Chisnall <theraven@theravensnest.org>, jonathan@FreeBSD.org
Subject:   Re: [Machine readable output from userland utilities] report
Message-ID:  <105B3699-2A41-4384-8D02-523D8445436B@mail.bg>
In-Reply-To: <5385BD49.5020602@FreeBSD.org>
References:  <8D1B686D-1AAA-4E07-9270-E42699110561@mail.bg> <4890861C-FC91-445D-AE9B-31CD5FDFD0A9@theravensnest.org> <15BC1D7C-B909-48DB-AB6D-FF0F0F9C2B0A@mail.bg> <899129C5-977C-4CE7-A873-460D69D6EA85@theravensnest.org> <5385BD49.5020602@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Le 28 May 2014 =E0 13:41, Vsevolod Stakhov a =E9crit :

> David, Zaro,
>=20
> 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?
>=20
> 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 :)

>=20
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?105B3699-2A41-4384-8D02-523D8445436B>