Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DrainTimeout = 256 * time.Millisecond
Functions ¶
This section is empty.
Types ¶
type BlockingSubject ¶ added in v0.132.0
type Buffered ¶
type Buffered[Data any] func(testing.TB) BufferedSubject[Data]
Buffered defines a publisher behaviour where if the subscription is canceled, the publisher messages can be still consumed after resubscribing.
type BufferedSubject ¶ added in v0.132.0
type FIFO ¶
type FIFO[Data any] func(testing.TB) FIFOSubject[Data]
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.
type FIFOSubject ¶ added in v0.132.0
type FanOut ¶ added in v0.128.0
type FanOut[Data any] func(testing.TB) FanOutSubject[Data]
FanOut defines an exchange behaviour where messages are published to all the associated pubsub.Queue.
type FanOutSubject ¶ added in v0.128.0
type FanOutSubject[Data any] struct { // Exchange is the publisher that suppose to publish to all queue made with MakeQueue. Exchange pubsub.Publisher[Data] // MakeQueue creates a queue and binds it to the Exchange to receive events. // Queues made with MakeQueue suppose to be cleaned up after the test. // For the cleanup purpose, use the testing.TB received as part of FanOut. MakeQueue func() pubsub.Subscriber[Data] MakeContext func() context.Context MakeData func() Data }
type LIFO ¶
type LIFO[Data any] func(testing.TB) LIFOSubject[Data]
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.
type LIFOSubject ¶ added in v0.132.0
type Queue ¶
type Queue[Data any] func(testing.TB) QueueSubject[Data]
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.
type QueueSubject ¶ added in v0.132.0
type Volatile ¶
type Volatile[Data any] func(testing.TB) VolatileSubject[Data]
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.