Module chewdata::step::writer

source ·
Expand description

Write data into the crate::document through the crate::connector.

§Actions

1 - Get a crate::Context from the input queue.
2 - Extract the crate::DataResult from the crate::Context.
2 - Write data in the crate::document though the crate::connector.
5 - Clone the current crate::Context.
6 - Push the crate::Context into the output queue.
7 - Go to step 1 until the input queue is not empty.

§Configuration

keyaliasDescriptionDefault ValuePossible Values
type-Required in order to use writer step.writerwriter / write / w
connector_tyoeconn / connectorConnector type to use in order to read a resource.ioSee crate::connector
document_tyoedoc / documentDocument type to use in order to manipulate the resource.jsonSee crate::document
namealiasName step.nullAuto generate alphanumeric value
data_typedataData type read for writing. skip other data type.okok / err
concurrency_limit-Limit of steps to run in concurrence.1unsigned number
dataset_limitbatchStack size limit before to push data into the resource though the connector.1000unsigned number

§Examples

[
    ...
    {
        "type": "writer",
        "name": "write_a",
        "connector": {
            "type": "io"
        },
        "document": {
            "type": "json"
        },
        "data": "ok",
        "concurrency_limit": 1,
        "dataset_limit": 1000
    },
    {
        "type": "writer",
        "name": "write_b",
        "connector": {
            "type": "local",
            "path": "./data/my_data.{{ metadata.mime_subtype }}"
        },
        "document": {
            "type": "json"
        }
    }
    ...
]

Structs§