fanin

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SourceTopics contains topics on which FanIn subscribes.
	SourceTopics []string

	// TargetTopic determines the topic on which messages from SourceTopics are published.
	TargetTopic string

	// CloseTimeout determines how long router should work for handlers when closing.
	CloseTimeout time.Duration
}

func (*Config) Validate

func (c *Config) Validate() error

type FanIn

type FanIn struct {
	// contains filtered or unexported fields
}

FanIn is a component that receives messages from 1..N topics from a subscriber and publishes them on a specified topic in the publisher. In effect, messages are "multiplexed".

func NewFanIn

func NewFanIn(
	subscriber message.Subscriber,
	publisher message.Publisher,
	config Config,
	logger watermill.LoggerAdapter,
) (*FanIn, error)

NewFanIn creates a new FanIn.

func (*FanIn) Close

func (f *FanIn) Close() error

Close gracefully closes the FanIn

func (*FanIn) Run

func (f *FanIn) Run(ctx context.Context) error

Run runs the FanIn.

func (*FanIn) Running

func (f *FanIn) Running() chan struct{}

Running is closed when FanIn is running.

Jump to

Keyboard shortcuts

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