Documentation
¶
Index ¶
- Variables
- func Blocking[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func Buffered[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func FIFO[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func FanOut[Data any](Exchange pubsub.Publisher[Data], ...) contract.Contract
- func LIFO[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func Ordering[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func Queue[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- func Volatile[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], ...) contract.Contract
- type Config
- type Option
- type PubSub
Constants ¶
This section is empty.
Variables ¶
var DrainTimeout = 256 * time.Millisecond
Functions ¶
func Buffered ¶
func Buffered[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
Buffered defines a publisher behaviour where if the subscription is canceled, the publisher messages can be still consumed after resubscribing.
func FIFO ¶
func FIFO[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
FIFO
It stands for First-In-First-Out approach. In this, the new element is inserted below the existing element, So that the oldest element can be at the top and taken out first. Therefore, the first element to be entered in this approach, gets out First. In computing, FIFO approach is used as an operating system algorithm, which gives every process CPU time in the order they arrive. The data structure that implements FIFO is Queue.
func FanOut ¶
func FanOut[Data any]( Exchange pubsub.Publisher[Data], MakeQueue func(testing.TB) pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
FanOut defines an exchange behaviour where messages are published to all the associated pubsub.Queue.
func LIFO ¶
func LIFO[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
LIFO
It stands for Last-In-First-Out approach in programming. In this, the new element is inserted above the existing element, So that the newest element can be at the top and taken out first. Therefore, the first element to be entered in this approach, gets out Last. In computing, LIFO approach is used as a queuing theory that refers to the way items are stored in types of data structures. The data structure that implements LIFO is Stack.
func Ordering ¶
func Ordering[Data any]( publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], Sort func([]Data), opts ...Option[Data], ) contract.Contract
Ordering is a contract that describes how the ordering should happen with a given
func Queue ¶
func Queue[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
Queue defines a publisher behaviour where each message is only delivered to a single subscriber, and not to all registered subscribers. If a message is ack-ed, the message will be permanently removed from the Queue.
func Volatile ¶
func Volatile[Data any](publisher pubsub.Publisher[Data], subscriber pubsub.Subscriber[Data], opts ...Option[Data]) contract.Contract
Volatile defines a publisher behaviour where if the subscription is canceled, published messages won't be delivered. In certain scenarios, you may want to send a volatile message with no assurances over a publisher, when timely delivery is more important than losing messages.