Documentation ¶
Overview ¶
Package combo provides different Publisher implementations that delegate the work to real implementations, such as calling another publisher if one fails.
Index ¶
- func NewFallbackPublisher(publishers ...publisher.Publisher) publisher.Publisher
- func NewFanoutPublisher(publishers ...publisher.Publisher) publisher.Publisher
- func NewPiggybackedPublisher(primary, carried publisher.Publisher) publisher.Publisher
- func NewPrioritizedFanoutPublisher(timeout time.Duration, publishers ...publisher.Publisher) publisher.Publisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFallbackPublisher ¶
NewFallbackPublisher returns a publisher.Publisher that will try multiple other Publishers in order until one succeeds.
The Publishers are tried in the order specified in the call to NewFallbackPublisher. If and only if all the Publishers return an error result, the fallback publisher will also return an error result. Otherwise, it will return the result of the first Publisher to succeed and will swallow any errors. Subsequent Publishers will not be attempted after one succeeds.
func NewFanoutPublisher ¶
func NewPiggybackedPublisher ¶
NewPiggybackedPublisher will return a new publisher.Publisher that will call `primary` before then calling `carried`. An error will be returned if the `carried` publisher fails, otherwise the returned objects will come from the `primary` publisher.
Types ¶
This section is empty.