actor_grpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotRunning = errors.New("client has stopped")
)
View Source
var SessionId = _gen_session_id()

Functions

This section is empty.

Types

type BaseHandler

type BaseHandler struct {
	*Session
}

type Client

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

func NewClient

func NewClient(host string, newHandler func() IHandler) *Client

func (*Client) IsRunning

func (g *Client) IsRunning() bool

func (*Client) Start

func (g *Client) Start(reconnect bool) error

func (*Client) Stop

func (g *Client) Stop()

type ClientHander

type ClientHander struct {
	BaseHandler
	// contains filtered or unexported fields
}

func (*ClientHander) OnRecv

func (s *ClientHander) OnRecv(msg *actor_msg.ActorMessage)

func (*ClientHander) OnSessionClosed

func (s *ClientHander) OnSessionClosed()

func (*ClientHander) OnSessionCreated

func (s *ClientHander) OnSessionCreated()

type IHandler

type IHandler interface {
	OnRecv(*actor_msg.ActorMessage)
	OnSessionCreated()
	OnSessionClosed()
	// contains filtered or unexported methods
}

type IStream

type IStream interface {
	Send(*actor_msg.ActorMessage) error
	Recv() (*actor_msg.ActorMessage, error)
}

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(host string, newHandler func() IHandler, ext interface{}) (*Server, error)

func (*Server) Receive

func (this *Server) Receive(stream actor_msg.ActorService_ReceiveServer) error

type Session

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

func NewSession

func NewSession(stream IStream, handler IHandler) *Session

func (*Session) Id

func (s *Session) Id() int64

func (*Session) Send

func (s *Session) Send(msg *actor_msg.ActorMessage) (err error)

func (*Session) Stop

func (s *Session) Stop()

Jump to

Keyboard shortcuts

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