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 if the context contains a deadline and it draws near the attempt becomes progressively less graceful.
If the context is cancelled an error is returned _after_ asynchronously instructing the remaining stream components to terminate ungracefully.
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) 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.