comment uring test and update readme

This commit is contained in:
smallnest
2023-08-05 23:19:00 +08:00
parent 6889a7879d
commit 3d6efeec33
3 changed files with 27 additions and 47 deletions

12
.github/FUNDING.yml vendored
View File

@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://github.com/smallnest/sponsors/blob/master/FUNDING.md'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -5,7 +5,7 @@
Official site: [http://rpcx.io](http://rpcx.io/) Official site: [http://rpcx.io](http://rpcx.io/)
[![License](https://img.shields.io/:license-apache%202-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/smallnest/rpcx?status.png)](http://godoc.org/github.com/smallnest/rpcx) [![travis](https://travis-ci.org/smallnest/rpcx.svg?branch=master)](https://travis-ci.org/smallnest/rpcx) [![Go Report Card](https://goreportcard.com/badge/github.com/smallnest/rpcx)](https://goreportcard.com/report/github.com/smallnest/rpcx) [![coveralls](https://coveralls.io/repos/smallnest/rpcx/badge.svg?branch=master&service=github)](https://coveralls.io/github/smallnest/rpcx?branch=master) [![QQ3群](https://img.shields.io/:QQ3群-953962236-blue.svg)](_documents/rpcx_dev_qq3.jpg) [![License](https://img.shields.io/:license-apache%202-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/smallnest/rpcx?status.png)](http://godoc.org/github.com/smallnest/rpcx) [![github actions](https://github.com/smallnest/rpcx/actions)](https://github.com/smallnest/rpcx/actions/workflows/go.yml/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/smallnest/rpcx)](https://goreportcard.com/report/github.com/smallnest/rpcx) [![coveralls](https://coveralls.io/repos/smallnest/rpcx/badge.svg?branch=master&service=github)](https://coveralls.io/github/smallnest/rpcx?branch=master) [![QQ3群](https://img.shields.io/:QQ3群-953962236-blue.svg)](_documents/rpcx_dev_qq3.jpg)
**Notice: etcd** **Notice: etcd**

View File

@@ -3,44 +3,36 @@
package client package client
import ( // func TestXClient_IOUring(t *testing.T) {
"context" // s := server.NewServer()
"testing" // s.RegisterName("Arith", new(Arith), "")
"time" // go s.Serve("iouring", "127.0.0.1:8972")
// defer s.Close()
// time.Sleep(500 * time.Millisecond)
"github.com/smallnest/rpcx/server" // addr := s.Address().String()
)
func TestXClient_IOUring(t *testing.T) { // d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service")
s := server.NewServer() // if err != nil {
s.RegisterName("Arith", new(Arith), "") // t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
go s.Serve("iouring", "127.0.0.1:8972") // }
defer s.Close()
time.Sleep(500 * time.Millisecond)
addr := s.Address().String() // xclient := NewXClient("Arith", Failtry, RandomSelect, d, DefaultOption)
d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service") // defer xclient.Close()
if err != nil {
t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
}
xclient := NewXClient("Arith", Failtry, RandomSelect, d, DefaultOption) // args := &Args{
// A: 10,
// B: 20,
// }
defer xclient.Close() // reply := &Reply{}
// err = xclient.Call(context.Background(), "Mul", args, reply)
// if err != nil {
// t.Fatalf("failed to call: %v", err)
// }
args := &Args{ // if reply.C != 200 {
A: 10, // t.Fatalf("expect 200 but got %d", reply.C)
B: 20, // }
} // }
reply := &Reply{}
err = xclient.Call(context.Background(), "Mul", args, reply)
if err != nil {
t.Fatalf("failed to call: %v", err)
}
if reply.C != 200 {
t.Fatalf("expect 200 but got %d", reply.C)
}
}