mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-14 15:54:42 +08:00
提交origin2.0版本
This commit is contained in:
27
example/serviceTest/OriginServerTwo.go
Normal file
27
example/serviceTest/OriginServerTwo.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package serviceTest
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/duanhf2012/originnet/service"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OriginServerTwo struct {
|
||||
service.Service
|
||||
}
|
||||
|
||||
func (slf *OriginServerTwo) RPC_TestCall(a *int,b *int) error {
|
||||
fmt.Printf("OriginServerTwo\n")
|
||||
*a = *b*2
|
||||
//slf.AfterFunc(time.Second,slf.Test)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (slf *OriginServerTwo) RPC_TestAsyncCall(a *int, reply *TestAsyn) error {
|
||||
fmt.Printf("OriginServerTwo async start sleep %d\n", *a)
|
||||
time.Sleep(time.Second)
|
||||
|
||||
reply.a = *a
|
||||
reply.b = "fuck!"
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user