• zhiqiangxu's avatar
    rpc: add method to test for subscription support (#25942) · 6f08c2f3
    zhiqiangxu authored
    This adds two ways to check for subscription support. First, one can now check
    whether the transport method (HTTP/WS/etc.) is capable of subscriptions using
    the new Client.SupportsSubscriptions method.
    
    Second, the error returned by Subscribe can now reliably be tested using this
    pattern:
        
        sub, err := client.Subscribe(...)
        if errors.Is(err, rpc.ErrNotificationsUnsupported) {
            // no subscription support
        }
    
    ---------
    Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
    6f08c2f3
handler.go 16.6 KB