Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

app-token-issuer-foundations[bot]
Copy link

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@chainlink/wsrpc@0.8.1

Patch Changes

  • #53 94c9fea Thanks @erikburt! - Update dependencies

  • #53 94c9fea Thanks @erikburt! - Remove deprecated usages of protogen Annotate method

  • Use context to cancel a blocking Dial.

    // With timeout
    ctx := context.Background()
    ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
    defer cancel()
    conn, err := wsrpc.DialWithContext(ctx, "127.0.0.1:1338",
    	wsrpc.WithTransportCreds(privKey, serverPubKey),
    	wsrpc.WithBlock(),
    )
    
    // Manual cancel
    ctx := context.Background()
    ctx, cancel := context.WithCancel(ctx)
    go func() {
      conn, err := wsrpc.DialWithContext(ctx, "127.0.0.1:1338",
    	wsrpc.WithTransportCreds(privKey, serverPubKey),
    	wsrpc.WithBlock(),
    )}()
    
    // Something causes the need to cancel.
    cancel()
    
  • Subscribe to a notification channel to get updates when a client connection is
    established or dropped. You can then retrieve the latest list of keys

    go func() {
    	for {
    		notifyCh := s.GetConnectionNotifyChan()
    		<-notifyCh
    
    		fmt.Println("Connected to:", s.GetConnectedPeerPublicKeys())
    	}
    }()
    

0.2.0

  • Replace metadata public key context with with a peer context.

    Extracting a public key

      // Previously
    pubKey, ok := metadata.PublicKeyFromContext(ctx)
    if !ok {
    	return nil, errors.New("could not extract public key")
    }
    
      // Now
      p, ok := peer.FromContext(ctx)
    if !ok {
    	return nil, errors.New("could not extract peer information")
    }
      pubKey := p.PublicKey
    

    Making a server side RPC call

    // Previously
    ctx := context.WithValue(context.Background(), metadata.PublicKeyCtxKey, pubKey)
    res, err := c.Gnip(ctx, &pb.GnipRequest{Body: "Gnip"})
    
    // Now
    ctx := peer.NewCallContext(context.Background(), pubKey)
    res, err := c.Gnip(ctx, &pb.GnipRequest{Body: "Gnip"})
    
  • Add a WithBlock DialOption which blocks the caller of Dial until the underlying connection is up.

0.1.1

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants