Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch authored and tmaxmax committed Jan 14, 2025
1 parent bcfdd94 commit 75af930
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This version removes all external dependencies of `go-sse`. All our bugs are bel

### Removed

- `Client.DefautReconnectionTime`, `Client.MaxRetries` have been replaced with the new `Client.Backoff` configuration field. See the Added section for more info.
- `Client.DefaultReconnectionTime`, `Client.MaxRetries` have been replaced with the new `Client.Backoff` configuration field. See the Added section for more info.
- `ErrReplayFailed` is removed from the public API.
- `ReplayProviderWithGC` and `Joe.ReplayGCInterval` are no more. The responsibility for garbage collection is assigned to the replay providers.

Expand Down Expand Up @@ -91,7 +91,7 @@ This version overhauls connection retry and fixes the connection event dispatch
- `*url.Error`s that occur on the HTTP request are now unwrapped and their cause is put inside a `ConnectionError`.
- `Connection.Connect` doesn't suppress any errors anymore: the request context errors are returned as is, all other errors are wrapped inside `ConnectionError`.
- On reconnection attempt, the response reset error is now wrapped inside `ConnectionError`. With this change, all errors other than the context errors are wrapped inside `ConnectionError`.
- Subscription callbacks are no longer called in individual goroutines. This caused messages to be received in an indereminate order. Make sure that your callbacks do not block for too long!
- Subscription callbacks are no longer called in individual goroutines. This caused messages to be received in an indeterminate order. Make sure that your callbacks do not block for too long!

### Changed

Expand Down Expand Up @@ -188,7 +188,7 @@ Documentation and examples were also fixed and improved.
- `sse.Message`: `AppendData` takes `string`s instead of `[]byte`.
- `sse.Message`: `Comment` is now named `AppendComment`, for consistency with `AppendData`.
- `sse.Message`: The message's expiration is not reset anymore by `UnmarshalText`.
- `sse.Message`: `UnmarshalText` now unmarshals comments aswell.
- `sse.Message`: `UnmarshalText` now unmarshals comments as well.
- `sse.Message`: `WriteTo` (and `MarshalText` and `String` as a result) replaces all newline sequences in data with LF.
- `sse.Message`: The `Expiry` getter and `SetExpiresAt`, `SetTTL` setters are replaced by the public field `ExpiresAt`.
- `sse.Message`: Event ID getter and setter are replaced by the public `ID` field.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ and he'll dispatch events all day! By default, he has no memory of what events h
```go
type Replayer interface {
// Put a new event in the provider's buffer.
// If the provider automatically adds IDs aswell,
// If the provider automatically adds IDs as well,
// the returned message will also have the ID set,
// otherwise the input value is returned.
Put(msg *Message, topics []string) (*Message, error)
Expand All @@ -165,7 +165,7 @@ joe = &sse.Joe{Replayer: r}

will tell Joe to replay all valid events! Replayers can do so much more (for example, add IDs to events automatically): read the [docs][3] on how to use the existing ones and how to implement yours.

You can also implement your own replayers: maybe you need persistent storage for your events? Or event validity is determined based on other criterias than expiry time? And if you think your replayer may be useful to others, you are encouraged to share it!
You can also implement your own replayers: maybe you need persistent storage for your events? Or event validity is determined based on other criteria than expiry time? And if you think your replayer may be useful to others, you are encouraged to share it!

`go-sse` created the `Replayer` interface mainly for `Joe`, but it encourages you to integrate it with your own `Provider` implementations, where suitable.

Expand Down
2 changes: 1 addition & 1 deletion client_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (c *Connection) read(r io.Reader, setRetry func(time.Duration)) error {
// is blocked until the request's context is done or an error occurs.
//
// If the request's context is cancelled, Connect returns its error.
// Otherwise, if the maximum number or retries is made, the last error
// Otherwise, if the maximum number of retries is made, the last error
// that occurred is returned. Connect never returns otherwise – either
// the context is cancelled, or it's done retrying.
//
Expand Down
2 changes: 1 addition & 1 deletion internal/parser/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
FieldNameID = FieldName("id")
// FieldNameComment is a sentinel value that indicates
// comment fields. It is not a valid field name that should
// be written to a SSE stream.
// be written to an SSE stream.
FieldNameComment = FieldName(":")

maxFieldNameLength = 5
Expand Down
2 changes: 1 addition & 1 deletion joe.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (j *Joe) Publish(msg *Message, topics []string) error {
}
}

// Stop signals Joe to close all subscribers and stop receiving messages.
// Shutdown signals Joe to close all subscribers and stop receiving messages.
// It returns when all the subscribers are closed.
//
// Further calls to Stop will return ErrProviderClosed.
Expand Down
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (e *Message) appendText(isComment bool, chunks ...string) {
// any newline characters (\r or \n) and then append the resulted data.
//
// Given that clients treat all newlines the same and replace the original newlines with LF,
// for internal code simplicity AppendData replaces them aswell.
// for internal code simplicity AppendData replaces them as well.
func (e *Message) AppendData(chunks ...string) {
e.appendText(false, chunks...)
}
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ResponseWriter interface {
// MessageWriter is a special kind of response writer used by providers to
// send Messages to clients.
type MessageWriter interface {
// Sens sends the message to the client.
// Send sends the message to the client.
// To make sure it is sent, call Flush.
Send(m *Message) error
// Flush sends any buffered messages to the client.
Expand Down

0 comments on commit 75af930

Please sign in to comment.