Skip to content

Commit

Permalink
docs: improve docs and fix misspelling
Browse files Browse the repository at this point in the history
  • Loading branch information
mdawar committed Aug 11, 2024
1 parent 6ad72e9 commit 76ac9b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/mdawar/pubsub.svg)](https://pkg.go.dev/github.com/mdawar/pubsub)
[![Tests](https://github.com/mdawar/pubsub/actions/workflows/test.yml/badge.svg)](https://github.com/mdawar/pubsub/actions/workflows/test.yml)

`pubsub` is a simple and generic **topic-based** **publish/subscribe** library for in-process communication in **Go**.
`pubsub` is a simple and generic **topic-based** **publish/subscribe** package for in-process communication in **Go**.

## Installation

Expand Down
6 changes: 3 additions & 3 deletions broker.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package pubsub provides a generic and concurrency-safe, topic-based publish/subscribe library for in-process communication.
package pubsub

import (
Expand Down Expand Up @@ -139,9 +140,8 @@ func (b *Broker[T, P]) removeSubscription(sub <-chan Message[T, P], topic T) {
// This method will block if any of the subscription channels buffer is full.
// This can be used to guarantee message delivery.
//
// Publishing will be canceled if the context is canceled or the deadline is exceeded.
//
// The returned error will be error returned by [context.Context.Err].
// Publishing will be canceled if the context is canceled or the deadline is exceeded
// and the value of [context.Context.Err] will be returned.
func (b *Broker[T, P]) Publish(ctx context.Context, topic T, payload P) error {
b.mu.RLock()
defer b.mu.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func TestBrokerNumTopicsWithSubscribersOnSameTopic(t *testing.T) {

lastSubIndex := len(subs) - 1

// Remove all of the subscriptons and keep 1.
// Remove all of the subscriptions and keep 1.
for _, sub := range subs[:lastSubIndex] {
broker.Unsubscribe(sub, topic)
assertTopics(1)
Expand Down

0 comments on commit 76ac9b2

Please sign in to comment.