v0.9.2
This release adds new callback events for the subscription client that are useful for debugging and testing.
// OnConnectionAlive event is triggered whenever the WebSocket connection
// receives a connection alive message (differs per protocol)
client.OnConnectionAlive(fn func())
// OnSubscriptionComplete event is triggered when the subscription receives
// a terminated message from the server
client.OnSubscriptionComplete(fn func(sub Subscription))
New settings are also added to control the retry and exit behaviors of the subscription client.
client.WithoutLogTypes(graphql.GQLData, graphql.GQLConnectionKeepAlive).
// the client should exit when all subscriptions were closed, default true
WithExitWhenNoSubscription(false).
// WithRetryStatusCodes allow retrying the subscription connection when receiving one of these codes
// the input parameter can be a number string or range, e.g 4000-5000
WithRetryStatusCodes("4000", "4000-4050")
Changelog
- add
OnConnectionAlive
event to the subscription client (#77) @sermojohn - fix: prevent panic on late message after unsubscribed subscription (#79) @sermojohn
- improve the subscription life cycle events and add new settings (#82) @hgiasac