actor

package
v0.0.0-...-83fd405 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHttpRequestMinDispatchInterval = 0 * time.Millisecond

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View Source
const DefaultHttpRequestTimeout = 60 * time.Second

Variables

View Source
var (
	ErrInvalidLengthProto        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProto          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrAlreadyStop = errors.New("already stop")
View Source
var ErrHttpTaskNotFound = errors.New("http task not found")
View Source
var ErrHttpTaskOnCompletedMustNotNil = errors.New("http task on completed must not nil")
View Source
var ErrHttpTaskRequestMustNotNil = errors.New("http task request must not nil")
View Source
var ErrHttpTaskTimeoutMustGreaterThanZero = errors.New("http task timeout must > 0")

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View Source
var Protocol = nrpc.Protocol(nil)
View Source
var RootContext = actor.EmptyRootContext

Functions

func C2S_Promise_MessageID

func C2S_Promise_MessageID() rpc.MessageID

func C2S_Promise_MessageName

func C2S_Promise_MessageName() string

func C2S_Promise_ResponseMessageID

func C2S_Promise_ResponseMessageID() rpc.MessageID

func Close

func Close()

func DefaultDecider

func DefaultDecider(reason interface{}) actor.Directive

func ForwardToChildren

func ForwardToChildren(sender *actor.PID, iRecv nrpc.IMessage, iSend nrpc.IMessage, ctx actor.Context, args ...interface{})

func Init

func Init(logLevel alog.Level, logger nlog.ILogger)

func IsPIDPtrEmpty

func IsPIDPtrEmpty(pid *actor.PID) bool

func IsPIDValueEmpty

func IsPIDValueEmpty(pid actor.PID) bool

func Logger

func Logger() log.ILogger

func Put_C2S_Promise

func Put_C2S_Promise(i interface{})

func Put_S2C_Promise

func Put_S2C_Promise(i interface{})

func RequestFuture

func RequestFuture(pid *actor.PID, send nrpc.IMessage, timeout time.Duration) (nrpc.IMessage, error)

func S2C_Promise_MessageID

func S2C_Promise_MessageID() rpc.MessageID

func S2C_Promise_MessageName

func S2C_Promise_MessageName() string

func S2C_Promise_ResponseMessageID

func S2C_Promise_ResponseMessageID() rpc.MessageID

Types

type Actor

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func New

func New(optionFuncs ...OptionFunc) *Actor

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) Debug

func (a *Actor) Debug(format string, args ...interface{})

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) DispatchEvent

func (a *Actor) DispatchEvent(iEvent nevent.IEvent, ctx actor.Context, args ...interface{}) (err error)

func (*Actor) EachLogic

func (a *Actor) EachLogic(fn func(id nexport.LogicID, logic nexport.ILogic) (continued bool))

func (*Actor) Error

func (a *Actor) Error(format string, args ...interface{})

func (*Actor) GetLogic

func (a *Actor) GetLogic(id nexport.LogicID) nexport.ILogic

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (Actor) HttpServerListener

func (a Actor) HttpServerListener() net.Listener

func (*Actor) Info

func (a *Actor) Info(format string, args ...interface{})

func (Actor) IsStopping

func (a Actor) IsStopping() bool

func (Actor) Logger

func (a Actor) Logger() nlog.ILogger

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) NewHttpTask

func (a *Actor) NewHttpTask(timeout time.Duration, tag HttpTaskTag, prepare OnHttpTaskPrepare, callback OnHttpTaskCompleted) (taskID HttpTaskID, err error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) NewLoopTimer

func (a *Actor) NewLoopTimer(dur time.Duration, tag TimerID, cb TimerCallback) TimerID

func (*Actor) NewPromise

func (a *Actor) NewPromise() (promise *Promise)

func (*Actor) NewRPCPromise

func (a *Actor) NewRPCPromise(iRequestMessage nrpc.IMessage, receiver *actor.PID, cb PromiseCallback) (promise *Promise)

func (*Actor) NewTimer

func (a *Actor) NewTimer(dur time.Duration, tag TimerTag, cb TimerCallback) TimerID

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (Actor) PID

func (a Actor) PID() *actor.PID

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (Actor) ParentPID

func (a Actor) ParentPID() *actor.PID

func (*Actor) Poison

func (a *Actor) Poison() error

func (*Actor) PoisonAndWait

func (a *Actor) PoisonAndWait() error

func (*Actor) PostEvent

func (a *Actor) PostEvent(iEvent nevent.IEvent)

func (Actor) PromiseNum

func (a Actor) PromiseNum() int

func (*Actor) Receive

func (a *Actor) Receive(ctx actor.Context)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) RegisterEventHandler

func (a *Actor) RegisterEventHandler(id nevent.ID, h nevent.Handler)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) RegisterHttpRequestHandler

func (a *Actor) RegisterHttpRequestHandler(pattern string, fn http.HandlerFunc, option *HttpRequestHandlerOption) (err error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) RegisterMessageHandler

func (a *Actor) RegisterMessageHandler(id npb.MessageID, handler npb.MessageHandler) (err error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) RegisterRPCHandler

func (a *Actor) RegisterRPCHandler(id nrpc.MessageID, handler nrpc.MessageHandler) (err error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) SetSign

func (a *Actor) SetSign(sign string)

func (Actor) Sign

func (a Actor) Sign() string

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) Start

func (a *Actor) Start(ctx actor.Context, name string) (err error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Actor) Stop

func (a *Actor) Stop() error

func (*Actor) StopAndWait

func (a *Actor) StopAndWait() error

func (*Actor) StopTimer

func (a *Actor) StopTimer(id TimerID) error

func (*Actor) WaitForStarted

func (a *Actor) WaitForStarted()

func (*Actor) WaitForStopped

func (a *Actor) WaitForStopped()

func (*Actor) Warn

func (a *Actor) Warn(format string, args ...interface{})

type C2S_Promise

type C2S_Promise struct {
	///序列
	Seq uint64 `protobuf:"varint,1,opt,name=Seq,proto3" json:"Seq,omitempty"`
	///请求消息id
	ReqMsgID uint32 `protobuf:"varint,2,opt,name=ReqMsgID,proto3" json:"ReqMsgID,omitempty"`
	///请求消息数据
	ReqMsgData []byte `protobuf:"bytes,3,opt,name=ReqMsgData,proto3" json:"ReqMsgData,omitempty"`
}

/ 异步请求 @id=1

func Get_C2S_Promise

func Get_C2S_Promise() *C2S_Promise

func New_C2S_Promise

func New_C2S_Promise() *C2S_Promise

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// message C2S_Promise begin

func (*C2S_Promise) Clone

func (m *C2S_Promise) Clone() *C2S_Promise

func (*C2S_Promise) Descriptor

func (*C2S_Promise) Descriptor() ([]byte, []int)

func (*C2S_Promise) Equal

func (this *C2S_Promise) Equal(that interface{}) bool

func (*C2S_Promise) GetReqMsgData

func (m *C2S_Promise) GetReqMsgData() []byte

func (*C2S_Promise) GetReqMsgID

func (m *C2S_Promise) GetReqMsgID() uint32

func (*C2S_Promise) GetSeq

func (m *C2S_Promise) GetSeq() uint64

func (*C2S_Promise) GoString

func (this *C2S_Promise) GoString() string

func (*C2S_Promise) Marshal

func (m *C2S_Promise) Marshal() (dAtA []byte, err error)

func (*C2S_Promise) MarshalTo

func (m *C2S_Promise) MarshalTo(dAtA []byte) (int, error)

func (*C2S_Promise) MarshalToSizedBuffer

func (m *C2S_Promise) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (C2S_Promise) MessageID

func (C2S_Promise) MessageID() rpc.MessageID

func (C2S_Promise) MessageName

func (C2S_Promise) MessageName() string

func (*C2S_Promise) ProtoMessage

func (*C2S_Promise) ProtoMessage()

func (C2S_Promise) RPC

func (C2S_Promise) RPC()

func (*C2S_Promise) Reset

func (m *C2S_Promise) Reset()

func (*C2S_Promise) ResetEx

func (m *C2S_Promise) ResetEx()

func (C2S_Promise) ResponseMessageID

func (C2S_Promise) ResponseMessageID() rpc.MessageID

func (*C2S_Promise) Size

func (m *C2S_Promise) Size() (n int)

func (*C2S_Promise) String

func (this *C2S_Promise) String() string

func (*C2S_Promise) Unmarshal

func (m *C2S_Promise) Unmarshal(dAtA []byte) error

func (*C2S_Promise) XXX_DiscardUnknown

func (m *C2S_Promise) XXX_DiscardUnknown()

func (*C2S_Promise) XXX_Marshal

func (m *C2S_Promise) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*C2S_Promise) XXX_Merge

func (m *C2S_Promise) XXX_Merge(src proto.Message)

func (*C2S_Promise) XXX_Size

func (m *C2S_Promise) XXX_Size() int

func (*C2S_Promise) XXX_Unmarshal

func (m *C2S_Promise) XXX_Unmarshal(b []byte) error

type ErrPromiseMarshalResponseMessageFail

type ErrPromiseMarshalResponseMessageFail struct {
	Seq               PromiseSeq
	RequestMessageID  nrpc.MessageID
	ResponseMessageID nrpc.MessageID
	Err               error
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseMarshalResponseMessageFail) Error

type ErrPromiseNotExist

type ErrPromiseNotExist struct {
	Seq PromiseSeq
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseNotExist) Error

func (e ErrPromiseNotExist) Error() string

type ErrPromiseProduceRequestMessageFail

type ErrPromiseProduceRequestMessageFail struct {
	Seq              PromiseSeq
	RequestMessageID nrpc.MessageID
	Err              error
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseProduceRequestMessageFail) Error

type ErrPromiseProduceResponseMessageFail

type ErrPromiseProduceResponseMessageFail struct {
	Seq               PromiseSeq
	RequestMessageID  nrpc.MessageID
	ResponseMessageID nrpc.MessageID
	Err               error
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseProduceResponseMessageFail) Error

type ErrPromiseTimeout

type ErrPromiseTimeout struct {
	Seq              PromiseSeq
	RequestMessageID nrpc.MessageID
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseTimeout) Error

func (e ErrPromiseTimeout) Error() string

type ErrPromiseUnmarshalRequestMessageFail

type ErrPromiseUnmarshalRequestMessageFail struct {
	Seq              PromiseSeq
	RequestMessageID nrpc.MessageID
	Err              error
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseUnmarshalRequestMessageFail) Error

type ErrPromiseUnmarshalResponseMessageFail

type ErrPromiseUnmarshalResponseMessageFail struct {
	Seq               PromiseSeq
	RequestMessageID  nrpc.MessageID
	ResponseMessageID nrpc.MessageID
	Err               error
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (ErrPromiseUnmarshalResponseMessageFail) Error

type HandlerOptionFunc

type HandlerOptionFunc func(option *HttpRequestHandlerOption)

func WithHttpRequestMinDispatchInterval

func WithHttpRequestMinDispatchInterval(minDispatchInterval time.Duration) HandlerOptionFunc

func WithHttpRequestQueued

func WithHttpRequestQueued(queued bool) HandlerOptionFunc

func WithHttpRequestTimeout

func WithHttpRequestTimeout(timeout time.Duration) HandlerOptionFunc

type HttpRequestHandlerOption

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func NewHttpHandlerOption

func NewHttpHandlerOption(optionFuncs ...HandlerOptionFunc) *HttpRequestHandlerOption

func (HttpRequestHandlerOption) MinDispatchInterval

func (o HttpRequestHandlerOption) MinDispatchInterval() time.Duration

func (HttpRequestHandlerOption) Timeout

type HttpTask

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (HttpTask) GetResponseBodyData

func (t HttpTask) GetResponseBodyData() (body []byte, err error)

func (HttpTask) ID

func (t HttpTask) ID() HttpTaskID

func (HttpTask) Tag

func (t HttpTask) Tag() HttpTaskTag

type HttpTaskID

type HttpTaskID = uint64

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

type HttpTaskManager

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func NewHttpTaskManager

func NewHttpTaskManager(pid *actor.PID) *HttpTaskManager

func (*HttpTaskManager) NewTask

func (m *HttpTaskManager) NewTask(timeout time.Duration, tag HttpTaskTag, onPrepare OnHttpTaskPrepare, onCompleted OnHttpTaskCompleted) (taskID HttpTaskID, err error)

func (*HttpTaskManager) OnCompleted

func (m *HttpTaskManager) OnCompleted(id HttpTaskID) (err error)

type HttpTaskTag

type HttpTaskTag = uint64

type IActor

type IActor interface {
	PID() *actor.PID
	ParentPID() *actor.PID
	Sign() string
	SetSign(sign string)
	Logger() nlog.ILogger
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Start(ctx actor.Context, name string) (err error)
	WaitForStarted()
	IsStopping() bool
	Stop() error
	WaitForStopped()
	StopAndWait() error
	Poison() error
	PoisonAndWait() error
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Debug(format string, args ...interface{})
	Info(format string, args ...interface{})
	Warn(format string, args ...interface{})
	Error(format string, args ...interface{})
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	NewTimer(dur time.Duration, tag TimerTag, cb TimerCallback) TimerID
	NewLoopTimer(dur time.Duration, tag TimerID, cb TimerCallback) TimerID
	StopTimer(id TimerID) error
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RegisterEventHandler(id nevent.ID, h nevent.Handler)
	DispatchEvent(iEvent nevent.IEvent, ctx actor.Context, args ...interface{}) (err error)
	PostEvent(iEvent nevent.IEvent)
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	NewHttpTask(timeout time.Duration, tag HttpTaskTag, prepare OnHttpTaskPrepare, callback OnHttpTaskCompleted) (taskID HttpTaskID, err error)
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RegisterRPCHandler(id nrpc.MessageID, handler nrpc.MessageHandler) (err error)
	NewPromise() (promise *Promise)
	NewRPCPromise(iRequestMessage nrpc.IMessage, receiver *actor.PID, cb PromiseCallback) (promise *Promise)
	PromiseNum() int
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RegisterMessageHandler(id npb.MessageID, handler npb.MessageHandler) (err error)
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RegisterHttpRequestHandler(pattern string, fn http.HandlerFunc, option *HttpRequestHandlerOption) (err error)
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	HttpServerListener() net.Listener
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	GetLogic(id nexport.LogicID) nexport.ILogic
	EachLogic(fn func(id nexport.LogicID, logic nexport.ILogic) (continued bool))
}

type IPromiseTask

type IPromiseTask interface {
	Promise() *Promise
	Next() IPromiseTask
	SetNext(next IPromiseTask)
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

type OnHttpTaskCompleted

type OnHttpTaskCompleted func(err error, task *HttpTask)

type OnHttpTaskPrepare

type OnHttpTaskPrepare func() (request *http.Request, err error)

type OptionFunc

type OptionFunc func(option *option)

func WithDecider

func WithDecider(decider actor.DeciderFunc) OptionFunc

func WithHttpServer

func WithHttpServer(listenAddr string, certFile string, keyFile string, afterRun VFAfterRunHttpServer,
	beforeDispatch VFBeforeDispatchHttpRequest, afterDispatch VFAfterDispatchHttpRequest) OptionFunc

func WithLogger

func WithLogger(logger nlog.ILogger) OptionFunc

func WithLogics

func WithLogics(logics map[nexport.LogicID]nexport.ILogic) OptionFunc

func WithMailBoxSize

func WithMailBoxSize(mailBoxSize int) OptionFunc

func WithMessage

func WithMessage(iProtocol npb.IProtocol, before VFBeforeDispatchMessage, after VFAfterDispatchMessage) OptionFunc

func WithOnActorTerminate

func WithOnActorTerminate(vf VFOnActorTerminated) OptionFunc

func WithOnReceiveMessage

func WithOnReceiveMessage(vf VFOnReceiveMessage) OptionFunc

func WithOnRestarted

func WithOnRestarted(vf VFOnRestarted) OptionFunc

func WithOnRestarting

func WithOnRestarting(vf VFOnRestarting) OptionFunc

func WithOnStarted

func WithOnStarted(vf VFOnStarted) OptionFunc

func WithOnStopped

func WithOnStopped(vf VFOnStopped) OptionFunc

func WithOnStopping

func WithOnStopping(vf VFOnStopping) OptionFunc

func WithPulse

func WithPulse(interval time.Duration, vf VFOnPulse) OptionFunc

func WithRPC

func WithRPC(iProtocol nrpc.IProtocol, before VFBeforeDispatchRPC, after VFAfterDispatchRPC) OptionFunc

func WithStartedWaitGroup

func WithStartedWaitGroup(startedWg *sync.WaitGroup) OptionFunc

func WithStoppedWaitGroup

func WithStoppedWaitGroup(stoppedWg *sync.WaitGroup) OptionFunc

func WithTimer

func WithTimer(before VFBeforeTriggerTimer, after VFAfterTriggerTimer) OptionFunc

type Promise

type Promise struct {
	*PromiseContext
	// contains filtered or unexported fields
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (*Promise) Add

func (p *Promise) Add(child *Promise) *Promise

func (*Promise) Execute

func (p *Promise) Execute() *Promise

func (*Promise) OnComplete

func (p *Promise) OnComplete(cb PromiseOnCompleted) *Promise

func (*Promise) SetTimeout

func (p *Promise) SetTimeout(timeout time.Duration) *Promise

func (*Promise) Then

func (p *Promise) Then(cb PromiseCallback) *Promise

type PromiseCallback

type PromiseCallback = func(ctx *PromiseContext)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

type PromiseContext

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

func (*PromiseContext) Error

func (p *PromiseContext) Error() error

func (PromiseContext) Receiver

func (p PromiseContext) Receiver() *actor.PID

func (PromiseContext) RequestMessage

func (p PromiseContext) RequestMessage() nrpc.IMessage

func (PromiseContext) Requested

func (p PromiseContext) Requested() bool

func (PromiseContext) ResponseMessage

func (p PromiseContext) ResponseMessage() nrpc.IMessage

func (PromiseContext) Seq

func (p PromiseContext) Seq() PromiseSeq

func (*PromiseContext) SetError

func (p *PromiseContext) SetError(err error)

func (*PromiseContext) SetReceiver

func (p *PromiseContext) SetReceiver(receiver *actor.PID)

func (*PromiseContext) SetRequestMessage

func (p *PromiseContext) SetRequestMessage(iRequestMessage nrpc.IMessage)

func (*PromiseContext) SetRequested

func (p *PromiseContext) SetRequested(requested bool)

func (*PromiseContext) SetResponseMessage

func (p *PromiseContext) SetResponseMessage(iResponseMessage nrpc.IMessage)

type PromiseOnCompleted

type PromiseOnCompleted = func(err error, ctx *PromiseContext)

type PromiseSeq

type PromiseSeq = uint64

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

type S2C_Promise

type S2C_Promise struct {
	///序列
	Seq uint64 `protobuf:"varint,1,opt,name=Seq,proto3" json:"Seq,omitempty"`
	///回复消息id
	RespMsgID uint32 `protobuf:"varint,2,opt,name=RespMsgID,proto3" json:"RespMsgID,omitempty"`
	///回复消息数据
	RespMsgData []byte `protobuf:"bytes,3,opt,name=RespMsgData,proto3" json:"RespMsgData,omitempty"`
}

/ 异步回复 @id=2

func Get_S2C_Promise

func Get_S2C_Promise() *S2C_Promise

func New_S2C_Promise

func New_S2C_Promise() *S2C_Promise

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// message S2C_Promise begin

func (*S2C_Promise) Clone

func (m *S2C_Promise) Clone() *S2C_Promise

func (*S2C_Promise) Descriptor

func (*S2C_Promise) Descriptor() ([]byte, []int)

func (*S2C_Promise) Equal

func (this *S2C_Promise) Equal(that interface{}) bool

func (*S2C_Promise) GetRespMsgData

func (m *S2C_Promise) GetRespMsgData() []byte

func (*S2C_Promise) GetRespMsgID

func (m *S2C_Promise) GetRespMsgID() uint32

func (*S2C_Promise) GetSeq

func (m *S2C_Promise) GetSeq() uint64

func (*S2C_Promise) GoString

func (this *S2C_Promise) GoString() string

func (*S2C_Promise) Marshal

func (m *S2C_Promise) Marshal() (dAtA []byte, err error)

func (*S2C_Promise) MarshalTo

func (m *S2C_Promise) MarshalTo(dAtA []byte) (int, error)

func (*S2C_Promise) MarshalToSizedBuffer

func (m *S2C_Promise) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (S2C_Promise) MessageID

func (S2C_Promise) MessageID() rpc.MessageID

func (S2C_Promise) MessageName

func (S2C_Promise) MessageName() string

func (*S2C_Promise) ProtoMessage

func (*S2C_Promise) ProtoMessage()

func (S2C_Promise) RPC

func (S2C_Promise) RPC()

func (*S2C_Promise) Reset

func (m *S2C_Promise) Reset()

func (*S2C_Promise) ResetEx

func (m *S2C_Promise) ResetEx()

func (S2C_Promise) ResponseMessageID

func (S2C_Promise) ResponseMessageID() rpc.MessageID

func (*S2C_Promise) Size

func (m *S2C_Promise) Size() (n int)

func (*S2C_Promise) String

func (this *S2C_Promise) String() string

func (*S2C_Promise) Unmarshal

func (m *S2C_Promise) Unmarshal(dAtA []byte) error

func (*S2C_Promise) XXX_DiscardUnknown

func (m *S2C_Promise) XXX_DiscardUnknown()

func (*S2C_Promise) XXX_Marshal

func (m *S2C_Promise) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*S2C_Promise) XXX_Merge

func (m *S2C_Promise) XXX_Merge(src proto.Message)

func (*S2C_Promise) XXX_Size

func (m *S2C_Promise) XXX_Size() int

func (*S2C_Promise) XXX_Unmarshal

func (m *S2C_Promise) XXX_Unmarshal(b []byte) error

type TimerCallback

type TimerCallback func(id TimerID, tag TimerTag)

type TimerID

type TimerID = uint64

type TimerManager

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

func NewTimerManager

func NewTimerManager(pid *actor.PID) *TimerManager

func (*TimerManager) NewLoopTimer

func (m *TimerManager) NewLoopTimer(dur time.Duration, callback TimerCallback) TimerID

func (*TimerManager) NewLoopTimerWithTag

func (m *TimerManager) NewLoopTimerWithTag(dur time.Duration, tag TimerTag, callback TimerCallback) TimerID

func (*TimerManager) NewTimer

func (m *TimerManager) NewTimer(dur time.Duration, callback TimerCallback) TimerID

func (*TimerManager) NewTimerWithTag

func (m *TimerManager) NewTimerWithTag(dur time.Duration, tag TimerTag, callback TimerCallback) TimerID

func (*TimerManager) Stop

func (m *TimerManager) Stop(id TimerID) error

func (*TimerManager) StopAll

func (m *TimerManager) StopAll()

func (*TimerManager) Trigger

func (m *TimerManager) Trigger(id TimerID) error

type TimerTag

type TimerTag = uint64

type VFAfterCompleteHttpTask

type VFAfterCompleteHttpTask func(err error, id HttpTaskID, tag HttpTaskTag, ctx actor.Context)

type VFAfterDispatchEvent

type VFAfterDispatchEvent func(err error, iEvent nevent.IEvent, ctx actor.Context, args ...interface{})

type VFAfterDispatchHttpRequest

type VFAfterDispatchHttpRequest func(err error, pattern string, w http.ResponseWriter, r *http.Request)

type VFAfterDispatchMessage

type VFAfterDispatchMessage func(err error, iRecv npb.IMessage, iSend npb.IMessage, ctx actor.Context, args ...interface{})

type VFAfterDispatchRPC

type VFAfterDispatchRPC func(err error, sender *actor.PID, iRequestMessage nrpc.IMessage, iResponseMessage nrpc.IMessage, ctx actor.Context, args ...interface{})

type VFAfterRunHttpServer

type VFAfterRunHttpServer func(err error)

type VFAfterTriggerTimer

type VFAfterTriggerTimer func(err error, id TimerID, tag TimerTag, ctx actor.Context)

type VFBeforeCompleteHttpTask

type VFBeforeCompleteHttpTask func(id HttpTaskID, tag HttpTaskTag, ctx actor.Context) (ok bool, err error)

type VFBeforeDispatchEvent

type VFBeforeDispatchEvent func(inEvent nevent.IEvent, ctx actor.Context) (args []interface{}, ok bool, err error)

type VFBeforeDispatchHttpRequest

type VFBeforeDispatchHttpRequest func(pattern string, w http.ResponseWriter, r *http.Request) (ok bool, err error)

type VFBeforeDispatchMessage

type VFBeforeDispatchMessage func(iProtocol npb.IProtocol, iRecv npb.IMessage, ctx actor.Context) (iSend npb.IMessage, args []interface{}, ok bool, err error)

type VFBeforeDispatchRPC

type VFBeforeDispatchRPC func(sender *actor.PID, iRequestMessage nrpc.IMessage, ctx actor.Context) (args []interface{}, ok bool, err error)

type VFBeforeTriggerTimer

type VFBeforeTriggerTimer func(id TimerID, tag TimerTag, ctx actor.Context) (ok bool, err error)

type VFOnActorTerminated

type VFOnActorTerminated func(who *actor.PID, ctx actor.Context)

type VFOnPulse

type VFOnPulse func(ctx actor.Context)

type VFOnReceiveMessage

type VFOnReceiveMessage func(ctx actor.Context)

type VFOnRestarted

type VFOnRestarted func(ctx actor.Context)

type VFOnRestarting

type VFOnRestarting func(ctx actor.Context)

type VFOnStarted

type VFOnStarted func(ctx actor.Context)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

type VFOnStopped

type VFOnStopped func(ctx actor.Context)

type VFOnStopping

type VFOnStopping func(ctx actor.Context)

Jump to

Keyboard shortcuts

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