Skip to content

v0.8.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@tmaxmax tmaxmax released this 30 Jan 20:46
· 3 commits to master since this release
v0.8.0
d2fe2fb

This version removes all external dependencies of go-sse. All our bugs are belong to us! It also does some API and documentation cleanups.

Removed

  • Client.DefautReconnectionTime, 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.

Changed

  • Server.Logger is now of a new type: the Logger interface. The dependency on x/exp/slog is removed. This opens up the possibility to adapt any existing logger to be usable with Server.
  • The default backoff behavior has changed. The previous defaults map to the new Backoff configuration as follows:
sse.Backoff{
    InitialInterval:    5 * time.Second,  // currently 500ms
    Multiplier:         1.5,              // currently the same
    Jitter:             0.5,              // currently the same
    MaxInterval:        60 * time.Second, // currently unbounded
    MaxElapsedDuration: 15 * time.Minute, // currently unbounded
    MaxRetries:         -1,               // previously no retries by default, currently unbounded
}
  • Joe now accepts new subscriptions even if replay providers panic (previously ErrReplayFailed would be returned).
  • Server.ServeHTTP panics if a custom OnSession handler returns a Subscription with 0 topics

Added

  • The Logger interface, LogLevel type, and LogLevel(Info|Warn|Error) values.
  • Backoff and Client.Backoff – the backoff strategy is now fully configurable. See the code documentation for info.
  • ValidReplayProvider.GCInterval, to configure at which interval expired events should be cleaned up.