יובל קוג'מן (Yuval Kogman)

NAME

POE::Filter::JSON::Incr - Parse JSON from streams without needing per-line input

SYNOPSIS

        POE::Wheel::Whatever->new(
                Filter => POE::Filter::JSON::Incr->new( ... );
        );

DESCRIPTION

This filter uses the incremental parsing support found in JSON::XS 2.2 and JSON 2.09 to decode JSON data from text streams without needing line by line input.

ATTRIBUTES

errors

When true causes POE::Filter::JSON::Incr::Error objects to be created as input on parse errors.

Defaults to false (errors are silently ignored).

error_class

Defaults to POE::Filter::JSON::Incr::Error.

json

The instance of the JSON object.

Note that this is stateful, due to the incremental API's interface.

json_opts

When no json object is provided, one will be created with these options. Defaults to utf8, relaxed and allow_nonref.

buffer

An array reference of deserialized values.

METHODS

See POE::Filter for the interface.

get \@chunks
get_one_start \@chunks
get_one

These methods will parse the text in @chunks. get will return an array reference containing all the parsed values, while get_one will remove one value from the buffer and return it in an array reference.

put \@data

This method serializes the data in @data and returns an array of JSON strings.

get_pending

Returns the decoded objects in the buffer without clearing it.

VERSION CONTROL

This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.

AUTHOR

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT

        Copyright (c) 2008 Yuval Kogman. All rights reserved
        This program is free software; you can redistribute
        it and/or modify it under the same terms as Perl itself.