You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Adam Kocoloski <ko...@apache.org> on 2009/08/18 16:15:49 UTC
new format for continuous _changes feed
Hi folks, I was talking with aquarius and rnewson on IRC about a
possible change to the format of the _changes feed. We agreed that it
made more sense for the feed=continuous mode to emit individual
newline-delimited valid JSON Objects and skip the commas that are
currently included. This will allow consumers to split on newlines
and immediately decode the result without any post-processing.
feed=normal and feed=longpoll would stay unchanged.
If there are no objections I can make this change today and update the
replicator as well. Best,
Adam
Re: new format for continuous _changes feed
Posted by Adam Kocoloski <ko...@apache.org>.
On Aug 18, 2009, at 10:21 AM, Stuart Langridge wrote:
> Adam Kocoloski wrote:
>> Hi folks, I was talking with aquarius and rnewson on IRC about a
>> possible change to the format of the _changes feed. We agreed that
>> it
>> made more sense for the feed=continuous mode to emit individual
>> newline-delimited valid JSON Objects and skip the commas that are
>> currently included. This will allow consumers to split on newlines
>> and
>> immediately decode the result without any post-processing.
>> feed=normal
>> and feed=longpoll would stay unchanged.
>
> So, just to confirm that I understand this correctly, the
> feed=continuous mode would print lots of lines which look like this,
> one
> for each change:
>
> {"seq":3,"id":"5643c5b300e3065839a5bde0b7332948","changes":
> [{"rev":"3-825cb35de44c433bfb2df415563a19de"}]}
>
> and if you pass since=<whatever> and there's more than one change
> since
> then, the feed would start off containing more than one line?
>
> sil
Exactly. In the case of a timeout I'm planning on the server sending
one last line
{"last_seq": 1234}
Best, Adam
Re: new format for continuous _changes feed
Posted by Stuart Langridge <st...@canonical.com>.
Adam Kocoloski wrote:
> Hi folks, I was talking with aquarius and rnewson on IRC about a
> possible change to the format of the _changes feed. We agreed that it
> made more sense for the feed=continuous mode to emit individual
> newline-delimited valid JSON Objects and skip the commas that are
> currently included. This will allow consumers to split on newlines and
> immediately decode the result without any post-processing. feed=normal
> and feed=longpoll would stay unchanged.
So, just to confirm that I understand this correctly, the
feed=continuous mode would print lots of lines which look like this, one
for each change:
{"seq":3,"id":"5643c5b300e3065839a5bde0b7332948","changes":[{"rev":"3-825cb35de44c433bfb2df415563a19de"}]}
and if you pass since=<whatever> and there's more than one change since
then, the feed would start off containing more than one line?
sil
Re: new format for continuous _changes feed
Posted by Adam Kocoloski <ko...@apache.org>.
On Aug 18, 2009, at 10:42 AM, Jason Davies wrote:
> On 18 Aug 2009, at 15:32, Benoit Chesneau wrote:
>
>> 2009/8/18 Adam Kocoloski <ko...@apache.org>:
>>> Hi folks, I was talking with aquarius and rnewson on IRC about a
>>> possible
>>> change to the format of the _changes feed. We agreed that it made
>>> more
>>> sense for the feed=continuous mode to emit individual newline-
>>> delimited
>>> valid JSON Objects and skip the commas that are currently
>>> included. This
>>> will allow consumers to split on newlines and immediately decode
>>> the result
>>> without any post-processing. feed=normal and feed=longpoll would
>>> stay
>>> unchanged.
>>>
>>> If there are no objections I can make this change today and update
>>> the
>>> replicator as well. Best,
>>>
>>> Adam
>>>
>>
>> This change would be nice indeed.
>
>
> +1
Committed in r805430. Cheers, Adam
Re: new format for continuous _changes feed
Posted by Jason Davies <ja...@jasondavies.com>.
On 18 Aug 2009, at 15:32, Benoit Chesneau wrote:
> 2009/8/18 Adam Kocoloski <ko...@apache.org>:
>> Hi folks, I was talking with aquarius and rnewson on IRC about a
>> possible
>> change to the format of the _changes feed. We agreed that it made
>> more
>> sense for the feed=continuous mode to emit individual newline-
>> delimited
>> valid JSON Objects and skip the commas that are currently
>> included. This
>> will allow consumers to split on newlines and immediately decode
>> the result
>> without any post-processing. feed=normal and feed=longpoll would
>> stay
>> unchanged.
>>
>> If there are no objections I can make this change today and update
>> the
>> replicator as well. Best,
>>
>> Adam
>>
>
> This change would be nice indeed.
+1
--
Jason Davies
www.jasondavies.com
Re: new format for continuous _changes feed
Posted by Benoit Chesneau <bc...@gmail.com>.
2009/8/18 Adam Kocoloski <ko...@apache.org>:
> Hi folks, I was talking with aquarius and rnewson on IRC about a possible
> change to the format of the _changes feed. We agreed that it made more
> sense for the feed=continuous mode to emit individual newline-delimited
> valid JSON Objects and skip the commas that are currently included. This
> will allow consumers to split on newlines and immediately decode the result
> without any post-processing. feed=normal and feed=longpoll would stay
> unchanged.
>
> If there are no objections I can make this change today and update the
> replicator as well. Best,
>
> Adam
>
This change would be nice indeed.
- benoît