Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptOnClose ¶
func OptOnClose(onClose func()) func(*Type)
OptOnClose sets a closure to be called when the stream closes.
Types ¶
type Config ¶
type Config struct { Input input.Config `json:"input" yaml:"input"` Buffer buffer.Config `json:"buffer" yaml:"buffer"` Pipeline pipeline.Config `json:"pipeline" yaml:"pipeline"` Output output.Config `json:"output" yaml:"output"` }
Config is a configuration struct representing all four layers of a Benthos stream.
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type creates and manages the lifetime of a Benthos stream.
func (*Type) IsReady ¶
IsReady returns a boolean indicating whether both the input and output layers of the stream are connected.
func (*Type) Stop ¶
Stop attempts to close the stream within the specified timeout period. Initially the attempt is graceful, but as the timeout draws close the attempt becomes progressively less graceful.
func (*Type) StopGracefully ¶
StopGracefully attempts to close the stream in the most graceful way by only closing the input layer and waiting for all other layers to terminate by proxy. This should guarantee that all in-flight and buffered data is resolved before shutting down.
func (*Type) StopOrdered ¶
StopOrdered attempts to close all components of the stream in the order of positions within the stream, this allows data to flush all the way through the pipeline under certain circumstances but is less graceful than stopGracefully, which should be attempted first.
func (*Type) StopUnordered ¶
StopUnordered attempts to close all components in parallel without allowing the stream to gracefully wind down in the order of component layers. This should only be attempted if both stopGracefully and stopOrdered failed.