@numaproj/numaflow-js - v0.0.0-alpha.4
    Preparing search index...

    Namespace sink

    Sink namespace for custom data sinks.

    Sinks are the terminal vertices in a Numaflow pipeline that write data to external systems. Use cases include:

    • Writing to databases
    • Publishing to message queues
    • Sending to external APIs
    • Custom storage systems
    import { sink } from '@numaproj/numaflow-js';

    const server = new sink.AsyncServer(async (datums) => {
    const responses: sink.Response[] = [];

    for await (const datum of datums) {
    try {
    // Write to your external system
    await writeToDatabase(datum.getValue());
    responses.push(sink.Response.ok(datum.id));
    } catch (error) {
    responses.push(sink.Response.failure(datum.id, error.message));
    }
    }

    return responses;
    });

    server.start();

    Classes

    AsyncServer
    Message
    Response
    Responses

    Interfaces

    Datum
    SystemMetadata
    UserMetadata

    Type Aliases

    SinkCallback