simple-source-with-sideinput

command module
v0.0.0-...-3ed587d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Simple Source

A simple example of a user-defined source. The SimpleSource is a basic source implementation that listens for changes in a side input file using a file watcher. When the specified side input file is created, its content is read, stored in a global variable, and sent through a global channel. This content is then consumed by the source and sent to the associated message channel.

The source maintains an array of messages and implements the Read(), Ack(), and Pending() methods.

The Read(x) function of the SimpleSource struct is responsible for reading data from the source (in this case, from the globalChan channel, which receives file content when a side input file is created) and sending this data to a specified message channel. The Ack() method acknowledges the last batch of messages returned by Read(). The Pending() method returns 0 to indicate that the simple source always has 0 pending messages.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL