v0.8.0
Pre-release
Pre-release
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.MaxRetrieshave been replaced with the newClient.Backoffconfiguration field. See the Added section for more info.ErrReplayFailedis removed from the public API.ReplayProviderWithGCandJoe.ReplayGCIntervalare no more. The responsibility for garbage collection is assigned to the replay providers.
Changed
Server.Loggeris now of a new type: theLoggerinterface. The dependency on x/exp/slog is removed. This opens up the possibility to adapt any existing logger to be usable withServer.- The default backoff behavior has changed. The previous defaults map to the new
Backoffconfiguration 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
}Joenow accepts new subscriptions even if replay providers panic (previouslyErrReplayFailedwould be returned).Server.ServeHTTPpanics if a customOnSessionhandler returns aSubscriptionwith 0 topics
Added
- The
Loggerinterface,LogLeveltype, andLogLevel(Info|Warn|Error)values. BackoffandClient.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.