这是indexloc提供的服务,不要输入任何密码
Skip to content

v0.9.2

Compare
Choose a tag to compare
@hgiasac hgiasac released this 17 Mar 15:20
· 43 commits to master since this release
0acd9d9

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