reworded docs and changed delivery bench cases

This commit is contained in:
2024-08-22 17:22:18 +01:00
parent f4321c6261
commit 5863882fe3
2 changed files with 10 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
package gubgub
// Forever wrapper makes it more explicit that a subscriber will never stop consuming messages.
// Forever wraps a subscriber that will never stop consuming messages.
// This helps avoiding subscribers that always return TRUE.
func Forever[T any](fn func(T)) Subscriber[T] {
return func(msg T) bool {
@@ -9,7 +9,7 @@ func Forever[T any](fn func(T)) Subscriber[T] {
}
}
// Once returns a subscriber that will consume only one message.
// Once wraps a subscriber that will consume only one message.
// This helps avoiding subscribers that always return FALSE.
func Once[T any](fn func(T)) Subscriber[T] {
return func(t T) bool {