{
    "content": [
        {
            "type": "text",
            "text": "# TAP::Parser::Multiplexer (perldoc)\n\n## NAME\n\nTAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers\n\n## SYNOPSIS\n\nuse TAP::Parser::Multiplexer;\nmy $mux = TAP::Parser::Multiplexer->new;\n$mux->add( $parser1, $stash1 );\n$mux->add( $parser2, $stash2 );\nwhile ( my ( $parser, $stash, $result ) = $mux->next ) {\n# do stuff\n}\n\n## DESCRIPTION\n\n\"TAP::Parser::Multiplexer\" gathers input from multiple TAP::Parsers. Internally it calls select\non the input file handles for those parsers to wait for one or more of them to have input\navailable.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (2 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "TAP::Parser::Multiplexer",
        "section": "",
        "mode": "perldoc",
        "summary": "TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers",
        "synopsis": "use TAP::Parser::Multiplexer;\nmy $mux = TAP::Parser::Multiplexer->new;\n$mux->add( $parser1, $stash1 );\n$mux->add( $parser2, $stash2 );\nwhile ( my ( $parser, $stash, $result ) = $mux->next ) {\n# do stuff\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Class Methods",
                        "lines": 5
                    },
                    {
                        "name": "Instance Methods",
                        "lines": 40
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 3.43\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use TAP::Parser::Multiplexer;\n\nmy $mux = TAP::Parser::Multiplexer->new;\n$mux->add( $parser1, $stash1 );\n$mux->add( $parser2, $stash2 );\nwhile ( my ( $parser, $stash, $result ) = $mux->next ) {\n# do stuff\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "\"TAP::Parser::Multiplexer\" gathers input from multiple TAP::Parsers. Internally it calls select\non the input file handles for those parsers to wait for one or more of them to have input\navailable.\n\nSee TAP::Harness for an example of its use.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Class Methods",
                        "content": "\"new\"\nmy $mux = TAP::Parser::Multiplexer->new;\n\nReturns a new \"TAP::Parser::Multiplexer\" object.\n"
                    },
                    {
                        "name": "Instance Methods",
                        "content": "\"add\"\n$mux->add( $parser, $stash );\n\nAdd a TAP::Parser to the multiplexer. $stash is an optional opaque reference that will be\nreturned from \"next\" along with the parser and the next result.\n\n\"parsers\"\nmy $count   = $mux->parsers;\n\nReturns the number of parsers. Parsers are removed from the multiplexer when their input is\nexhausted.\n\n\"next\"\nReturn a result from the next available parser. Returns a list containing the parser from which\nthe result came, the stash that corresponds with that parser and the result.\n\nmy ( $parser, $stash, $result ) = $mux->next;\n\nIf $result is undefined the corresponding parser has reached the end of its input (and will\nautomatically be removed from the multiplexer).\n\nWhen all parsers are exhausted an empty list will be returned.\n\nif ( my ( $parser, $stash, $result ) = $mux->next ) {\nif ( ! defined $result ) {\n# End of this parser\n}\nelse {\n# Process result\n}\n}\nelse {\n# All parsers finished\n}\n\nSee Also\nTAP::Parser\n\nTAP::Harness\n"
                    }
                ]
            }
        }
    }
}