json streaming does not work without node.js #7

Closed
speedym opened this Issue Sep 17, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@speedym

speedym commented Sep 17, 2012

Maybe I'm doing something wrong, but clarinet seems not to be working in browser in streaming mode. Normal "block" decoding example provided works just fine.

I'm trying to use it like this:

// depends on clarinet lib
function json_stream_parser_c()
{
    function on_close_object()
    {
        alert("on close object");
    }

    var stream_parser = clarinet.createStream();

    stream_parser.on("closeobject", on_close_object);
    stream_parser.write("{ }");
}

It would be very nice if I could use it without node.js plugin as part of a web-site I'm making (client side code).

@dscape

This comment has been minimized.

Show comment Hide comment
@dscape

dscape Sep 17, 2012

Owner

Hi @speedym

Just used the regular parser then, unless you are using something like @maxogden's dominode there's not much advantage to streams in the browser.

If you really want this feature to be tested and fixed I would suggest you create a test case and submit a PR. If all is good I'll merge into master!

Thanks for using clarinet!

Owner

dscape commented Sep 17, 2012

Hi @speedym

Just used the regular parser then, unless you are using something like @maxogden's dominode there's not much advantage to streams in the browser.

If you really want this feature to be tested and fixed I would suggest you create a test case and submit a PR. If all is good I'll merge into master!

Thanks for using clarinet!

@dscape dscape closed this Sep 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment