chanrpc

package
v0.0.0-...-a4d0fc7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Example
Output:

1
1 2 3
3
1
1 2 3
3

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallInfo

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

type Client

type Client struct {
	ChanAsynRet chan *RetInfo
	// contains filtered or unexported fields
}

func (*Client) AsynCall

func (c *Client) AsynCall(id interface{}, _args ...interface{})

func (*Client) Call0

func (c *Client) Call0(id interface{}, args ...interface{}) error

func (*Client) Call1

func (c *Client) Call1(id interface{}, args ...interface{}) (interface{}, error)

func (*Client) CallN

func (c *Client) CallN(id interface{}, args ...interface{}) ([]interface{}, error)

func (*Client) Cb

func (c *Client) Cb(ri *RetInfo)

func (*Client) Close

func (c *Client) Close()

type RetInfo

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

type Server

type Server struct {
	ChanCall chan *CallInfo
	// contains filtered or unexported fields
}

one server per goroutine (goroutine not safe) one client per goroutine (goroutine not safe)

func NewServer

func NewServer(l int) *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) Exec

func (s *Server) Exec(ci *CallInfo) (err error)

func (*Server) Go

func (s *Server) Go(id interface{}, args ...interface{})

goroutine safe

func (*Server) Open

func (s *Server) Open(l int) *Client

goroutine safe

func (*Server) Register

func (s *Server) Register(id interface{}, f interface{})

you must call the function before calling Open and Go

Jump to

Keyboard shortcuts

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