xclient

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XDial

func XDial(rpcAddr string, opts ...*codec.Option) (*client.Client, error)

dial Unified interface rpcAddr is a general format (protocol@addr) to represent a rpc server eg, http@10.0.0.1:7001, tcp@10.0.0.1:9999, unix@/tmp/geerpc.sock

Types

type XClient

type XClient struct {
	// contains filtered or unexported fields
}

func NewXClient

func NewXClient(d discovery.Discovery, mode discovery.SelectMode, opt *codec.Option) *XClient

return a XClient instanse

func (*XClient) BroadCast

func (x *XClient) BroadCast(ctx context.Context, serviceMethod string, args, reply interface{}) error

Broadcast invokes every server registered in discovery to call this serviceMethod

func (*XClient) Call

func (x *XClient) Call(ctx context.Context, serviceMethod string, args, reply interface{}) error

Call invokes the named function, waits for it to complete, and returns its error status. xc will choose a proper server according to Xclient.mode and discovery get method

func (*XClient) Close

func (x *XClient) Close() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL