Please help with writing spec for async JSON APIs
James M Snell
jasnell at gmail.com
Mon Aug 3 17:41:17 UTC 2015
On Mon, Aug 3, 2015 at 10:29 AM, Allen Wirfs-Brock
<allen at wirfs-brock.com> wrote:
> I have to guess at your semantics, but what you are trying to express above seems like something that can already be accomplished using the `reviver` argument to JSON.parse.
Yes and no. `reviver` achieves part of goal but but still assumes that
parsing is fundamentally blocking and assumes that I want to return
something and have that in-memory obj built up and returned. However,
if what I want instead is to forgo the creation of an in memory model
altogether and working simply from an incremental, async stream of
events, then I'm out of luck.
>> In other words: allowing for incremental access to the stream and fine
>> grained control over the parsing process, rather than having to block
>> while everything is parsed out, building up the in-memory object
>> model, then being forced to walk that model in order to do anything
>> Personally, I'm not overly concerned about the possibility of races.
> But, TC39 is concerned about races.
Granted ;-) ... there's a reason I prefixed that sentence with 'Personally' ;-)
>> - James
More information about the es-discuss