Skip to content

Quic

Spout for Quic

Bases: Spout

__init__(output, state, **kwargs)

Initialize the Quic class.

Parameters:

Name Type Description Default
output StreamingOutput

An instance of the StreamingOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius Quic rise \
    streaming \
        --output_kafka_topic quic_test \
        --output_kafka_cluster_connection_string localhost:9094 \
    none \
    listen \
        --args cert_path=/path/to/cert.pem key_path=/path/to/key.pem host=localhost port=4433

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_quic_spout:
        name: "Quic"
        method: "listen"
        args:
            cert_path: "/path/to/cert.pem"
            key_path: "/path/to/key.pem"
            host: "localhost"
            port: 4433
        output:
            type: "streaming"
            args:
                output_topic: "quic_test"
                kafka_servers: "localhost:9094"

handle_stream_data(data, stream_id) async

Handle incoming stream data.

:param data: The incoming data. :param stream_id: The ID of the stream.

listen(cert_path, key_path, host='localhost', port=4433)

📖 Start listening for data from the QUIC server.

Parameters:

Name Type Description Default
cert_path str

Path to the certificate file.

required
key_path str

Path to the private key file.

required
host str

Hostname to listen on. Defaults to "localhost".

'localhost'
port int

Port to listen on. Defaults to 4433.

4433

Raises:

Type Description
Exception

If unable to start the QUIC server.