Module bytewax.connectors.stdio

Connectors to console IO.

Expand source code
"""Connectors to console IO."""
from bytewax.outputs import DynamicOutput, StatelessSink

__all__ = [
    "StdOutput",
]


class _PrintSink(StatelessSink):
    def write_batch(self, items):
        for item in items:
            print(item)


class StdOutput(DynamicOutput):
    """Write each output item to stdout on that worker.

    Items consumed from the dataflow must look like a string. Use a
    proceeding map step to do custom formatting.

    Workers are the unit of parallelism.

    Can support at-least-once processing. Messages from the resume
    epoch will be duplicated right after resume.

    """

    def build(self, worker_index, worker_count):
        """See ABC docstring."""
        return _PrintSink()

Classes

class StdOutput

Write each output item to stdout on that worker.

Items consumed from the dataflow must look like a string. Use a proceeding map step to do custom formatting.

Workers are the unit of parallelism.

Can support at-least-once processing. Messages from the resume epoch will be duplicated right after resume.

Expand source code
class StdOutput(DynamicOutput):
    """Write each output item to stdout on that worker.

    Items consumed from the dataflow must look like a string. Use a
    proceeding map step to do custom formatting.

    Workers are the unit of parallelism.

    Can support at-least-once processing. Messages from the resume
    epoch will be duplicated right after resume.

    """

    def build(self, worker_index, worker_count):
        """See ABC docstring."""
        return _PrintSink()

Ancestors

Methods

def build(self, worker_index, worker_count)

See ABC docstring.

Expand source code
def build(self, worker_index, worker_count):
    """See ABC docstring."""
    return _PrintSink()