Documentation ¶
Index ¶
- Constants
- func IsNoSender(req *rpc.RpcMessageRequest) bool
- type ActorDispatcher
- func (dispatcher *ActorDispatcher) AddCallbackActor(session []byte, actor ICallbackUntypedActor, ttl time.Duration)
- func (dispatcher *ActorDispatcher) Destroy()
- func (dispatcher *ActorDispatcher) Dispatch(req *rpc.RpcMessageRequest)
- func (dispatcher *ActorDispatcher) RegisterActor(method string, actorCreateFun func() IUntypedActor, concurrentCount int)
- type ActorExecutor
- type ActorRef
- type ActorSystem
- func (system *ActorSystem) ActerOf(host string, port int, method string) ActorRef
- func (system *ActorSystem) CallbackActerOf(ttl time.Duration, actor ICallbackUntypedActor) ActorRef
- func (system *ActorSystem) LocalActorOf(method string) ActorRef
- func (system *ActorSystem) RegisterActor(method string, actorCreateFun func() IUntypedActor, concurrentCount int)
- type CallbackActorExecutor
- type DeadLetterActorRef
- type DefaultActorRef
- type ICallbackUntypedActor
- type ICreateInputHandler
- type IDefaultUntypedActor
- type IExecutor
- type IReceiveHandler
- type ISelfHandler
- type ISenderHandler
- type ITimeoutHandler
- type IUntypedActor
- type MsgReceiver
- type MsgSender
- type NewInput
- type Processor
- type RpcClient
- type RpcServer
- type UntypedActor
Constants ¶
View Source
const ( NoRpcHost string = "-" NoRpcPort int = 0 )
Variables ¶
This section is empty.
Functions ¶
func IsNoSender ¶
func IsNoSender(req *rpc.RpcMessageRequest) bool
Types ¶
type ActorDispatcher ¶
type ActorDispatcher struct {
// contains filtered or unexported fields
}
func NewActorDispatcher ¶
func NewActorDispatcher(sender *MsgSender) *ActorDispatcher
func (*ActorDispatcher) AddCallbackActor ¶ added in v1.0.1
func (dispatcher *ActorDispatcher) AddCallbackActor(session []byte, actor ICallbackUntypedActor, ttl time.Duration)
func (*ActorDispatcher) Destroy ¶ added in v1.0.1
func (dispatcher *ActorDispatcher) Destroy()
func (*ActorDispatcher) Dispatch ¶
func (dispatcher *ActorDispatcher) Dispatch(req *rpc.RpcMessageRequest)
func (*ActorDispatcher) RegisterActor ¶ added in v1.0.1
func (dispatcher *ActorDispatcher) RegisterActor(method string, actorCreateFun func() IUntypedActor, concurrentCount int)
type ActorExecutor ¶ added in v1.0.1
type ActorExecutor struct {
// contains filtered or unexported fields
}
func NewActorExecutor ¶ added in v1.0.1
func NewActorExecutor(concurrentCount int, actorCreateFun func() IUntypedActor) *ActorExecutor
func (*ActorExecutor) Execute ¶ added in v1.0.1
func (executor *ActorExecutor) Execute(req *rpc.RpcMessageRequest, msgSender *MsgSender)
type ActorRef ¶
type ActorRef interface { Tell(proto.Message, ActorRef) TellAndNoSender(proto.Message) GetMethod() string GetHost() string GetPort() int // contains filtered or unexported methods }
func NewActorRef ¶
func NewCallbackActorRef ¶ added in v1.0.1
func NewCallbackActorRef(ttl time.Duration, host string, port int, session []byte, callbackActor ICallbackUntypedActor, sender *MsgSender, dispatcher *ActorDispatcher) ActorRef
type ActorSystem ¶
type ActorSystem struct { Name string Host string Prot int RecvDecoder func([]byte, interface{}) // contains filtered or unexported fields }
func NewActorSystem ¶
func NewActorSystem(name, host string, port int) *ActorSystem
func NewActorSystemNoRpc ¶ added in v1.0.1
func NewActorSystemNoRpc(name string) *ActorSystem
func (*ActorSystem) ActerOf ¶
func (system *ActorSystem) ActerOf(host string, port int, method string) ActorRef
func (*ActorSystem) CallbackActerOf ¶ added in v1.0.1
func (system *ActorSystem) CallbackActerOf(ttl time.Duration, actor ICallbackUntypedActor) ActorRef
func (*ActorSystem) LocalActorOf ¶ added in v1.0.1
func (system *ActorSystem) LocalActorOf(method string) ActorRef
func (*ActorSystem) RegisterActor ¶ added in v1.0.1
func (system *ActorSystem) RegisterActor(method string, actorCreateFun func() IUntypedActor, concurrentCount int)
type CallbackActorExecutor ¶ added in v1.0.1
type CallbackActorExecutor struct { Task *timewheel.Task // contains filtered or unexported fields }
func NewCallbackActorExecutor ¶ added in v1.0.1
func NewCallbackActorExecutor(callbackPool *tunny.Pool, wraperChan chan wraper, actor ICallbackUntypedActor) *CallbackActorExecutor
func (*CallbackActorExecutor) Execute ¶ added in v1.0.1
func (executor *CallbackActorExecutor) Execute(req *rpc.RpcMessageRequest, msgSender *MsgSender)
type DeadLetterActorRef ¶
type DeadLetterActorRef struct {
DefaultActorRef
}
var NoSender *DeadLetterActorRef
func (*DeadLetterActorRef) GetHost ¶
func (ref *DeadLetterActorRef) GetHost() string
func (*DeadLetterActorRef) GetMethod ¶
func (ref *DeadLetterActorRef) GetMethod() string
func (*DeadLetterActorRef) GetPort ¶
func (ref *DeadLetterActorRef) GetPort() int
func (*DeadLetterActorRef) Tell ¶
func (ref *DeadLetterActorRef) Tell(message proto.Message, sender ActorRef)
func (*DeadLetterActorRef) TellAndNoSender ¶ added in v1.0.1
func (ref *DeadLetterActorRef) TellAndNoSender(message proto.Message)
type DefaultActorRef ¶
type DefaultActorRef struct { Host string Port int Method string Session []byte Sender *MsgSender // contains filtered or unexported fields }
func (*DefaultActorRef) GetHost ¶
func (ref *DefaultActorRef) GetHost() string
func (*DefaultActorRef) GetMethod ¶
func (ref *DefaultActorRef) GetMethod() string
func (*DefaultActorRef) GetPort ¶
func (ref *DefaultActorRef) GetPort() int
func (*DefaultActorRef) Tell ¶
func (ref *DefaultActorRef) Tell(message proto.Message, sender ActorRef)
func (*DefaultActorRef) TellAndNoSender ¶ added in v1.0.1
func (ref *DefaultActorRef) TellAndNoSender(message proto.Message)
type ICallbackUntypedActor ¶ added in v1.0.4
type ICallbackUntypedActor interface { IDefaultUntypedActor ITimeoutHandler }
type ICreateInputHandler ¶ added in v1.0.2
type IDefaultUntypedActor ¶ added in v1.0.4
type IDefaultUntypedActor interface { IReceiveHandler ISenderHandler ISelfHandler ICreateInputHandler }
type IExecutor ¶ added in v1.0.1
type IExecutor interface {
Execute(req *rpc.RpcMessageRequest, msgSender *MsgSender)
}
type IReceiveHandler ¶ added in v1.0.2
type ISelfHandler ¶ added in v1.0.2
type ISelfHandler interface {
SetSelf(self ActorRef)
}
type ISenderHandler ¶ added in v1.0.2
type ISenderHandler interface {
SetSender(sender ActorRef)
}
type ITimeoutHandler ¶ added in v1.0.2
type ITimeoutHandler interface {
OnTimeout()
}
type IUntypedActor ¶ added in v1.0.2
type IUntypedActor interface{}
type MsgReceiver ¶
type MsgReceiver struct {
// contains filtered or unexported fields
}
func NewMsgReceiver ¶
func NewMsgReceiver(host string, port int, dispatcher *ActorDispatcher) *MsgReceiver
func (*MsgReceiver) Receive ¶
func (rec *MsgReceiver) Receive(req *rpc.RpcMessageRequest)
type MsgSender ¶
type MsgSender struct {
// contains filtered or unexported fields
}
func NewMsgSender ¶
func NewMsgSender() *MsgSender
func (*MsgSender) Send ¶
func (sender *MsgSender) Send(req *rpc.RpcMessageRequest)
func (*MsgSender) SetMsgReceiver ¶
func (sender *MsgSender) SetMsgReceiver(receiver *MsgReceiver)
type RpcClient ¶
type RpcClient struct { Address string // contains filtered or unexported fields }
func NewRpcClient ¶
func (*RpcClient) DisConnect ¶
func (client *RpcClient) DisConnect()
func (*RpcClient) Send ¶
func (client *RpcClient) Send(req *rpc.RpcMessageRequest)
type RpcServer ¶
func NewRpcServer ¶
func NewRpcServer(host string, port int, msgReceiver *MsgReceiver) *RpcServer
func (*RpcServer) Send ¶
func (server *RpcServer) Send(ctx context.Context, in *rpc.RpcMessageRequest) (*rpc.RpcMessageResponse, error)
type UntypedActor ¶ added in v1.0.1
func (*UntypedActor) SetSelf ¶ added in v1.0.1
func (act *UntypedActor) SetSelf(self ActorRef)
func (*UntypedActor) SetSender ¶ added in v1.0.1
func (act *UntypedActor) SetSender(sender ActorRef)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.