mirror of
https://github.com/smallnest/rpcx.git
synced 2025-09-26 20:21:14 +08:00
comment uring test and update readme
This commit is contained in:
12
.github/FUNDING.yml
vendored
12
.github/FUNDING.yml
vendored
@@ -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']
|
@@ -5,7 +5,7 @@
|
||||
|
||||
Official site: [http://rpcx.io](http://rpcx.io/)
|
||||
|
||||
[](https://opensource.org/licenses/Apache-2.0) [](http://godoc.org/github.com/smallnest/rpcx) [](https://travis-ci.org/smallnest/rpcx) [](https://goreportcard.com/report/github.com/smallnest/rpcx) [](https://coveralls.io/github/smallnest/rpcx?branch=master) [](_documents/rpcx_dev_qq3.jpg)
|
||||
[](https://opensource.org/licenses/Apache-2.0) [](http://godoc.org/github.com/smallnest/rpcx) [](https://github.com/smallnest/rpcx/actions/workflows/go.yml/badge.svg) [](https://goreportcard.com/report/github.com/smallnest/rpcx) [](https://coveralls.io/github/smallnest/rpcx?branch=master) [](_documents/rpcx_dev_qq3.jpg)
|
||||
|
||||
**Notice: etcd**
|
||||
|
||||
|
@@ -3,44 +3,36 @@
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
// func TestXClient_IOUring(t *testing.T) {
|
||||
// s := server.NewServer()
|
||||
// s.RegisterName("Arith", new(Arith), "")
|
||||
// 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) {
|
||||
s := server.NewServer()
|
||||
s.RegisterName("Arith", new(Arith), "")
|
||||
go s.Serve("iouring", "127.0.0.1:8972")
|
||||
defer s.Close()
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
// d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service")
|
||||
// if err != nil {
|
||||
// t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
|
||||
// }
|
||||
|
||||
addr := s.Address().String()
|
||||
// xclient := NewXClient("Arith", Failtry, RandomSelect, d, DefaultOption)
|
||||
|
||||
d, err := NewPeer2PeerDiscovery("iouring@"+addr, "desc=a test service")
|
||||
if err != nil {
|
||||
t.Fatalf("failed to NewPeer2PeerDiscovery: %v", err)
|
||||
}
|
||||
// defer xclient.Close()
|
||||
|
||||
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{
|
||||
A: 10,
|
||||
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)
|
||||
}
|
||||
}
|
||||
// if reply.C != 200 {
|
||||
// t.Fatalf("expect 200 but got %d", reply.C)
|
||||
// }
|
||||
// }
|
||||
|
Reference in New Issue
Block a user