bytewax.connectors.demo#

Connectors for writing local-first demo dataflows.

Data#

X: TypeVar#

Classes#

class RandomMetricSource#
Bases:

Demo source that produces an infinite stream of random values.

Emits downstream (metric_name, val) 2-tuples.

If you want to emit multiple different metrics, create multiple bytewax.operators.input.input steps and bytewax.operators.merge.merge them.

Args: metric_name: To attach to each value.

interval: Emit a value on this cadence. Defaults to every 0.7
    seconds.

count: Number of values to generate. Defaults to infinite.

next_random: Callable used to generate the next random value.
    Defaults to a random `int` between 0 and 10.
metric_name: str#
interval: timedelta#

‘timedelta(…)’

count: int#
next_random: Callable[[], float]#
list_parts() List[str]#

A single stream of values.

build_part(
now: datetime,
for_part: str,
resume_state: Optional[bytewax.connectors.demo._RandomMetricState],
)#

See ABC docstring.

Join our community Slack channel

Need some help? Join our community!

If you have any trouble with the process or have ideas about how to improve this document, come talk to us in the #questions-answered Slack channel!

Join now