promise

package
v0.0.0-...-d62e3dc Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 Protocol = nrpc.Protocol(nil)

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 Put_C2S_Promise

func Put_C2S_Promise(i any)

func Put_S2C_Promise

func Put_S2C_Promise(i any)

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 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 any) 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 ErrMarshalResponseMessageFail

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

func (ErrMarshalResponseMessageFail) Error

type ErrNotExist

type ErrNotExist struct {
	Seq Seq
}

func (ErrNotExist) Error

func (e ErrNotExist) Error() string

type ErrProduceRequestMessageFail

type ErrProduceRequestMessageFail struct {
	Seq              Seq
	RequestMessageID nrpc.MessageID
	Err              error
}

func (ErrProduceRequestMessageFail) Error

type ErrProduceResponseMessageFail

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

func (ErrProduceResponseMessageFail) Error

type ErrTimeout

type ErrTimeout struct {
	Seq              Seq
	RequestMessageID nrpc.MessageID
}

func (ErrTimeout) Error

func (e ErrTimeout) Error() string

type ErrUnmarshalRequestMessageFail

type ErrUnmarshalRequestMessageFail struct {
	Seq              Seq
	RequestMessageID nrpc.MessageID
	Err              error
}

func (ErrUnmarshalRequestMessageFail) Error

type ErrUnmarshalResponseMessageFail

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

func (ErrUnmarshalResponseMessageFail) Error

type IPromiseTask

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

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() *aactor.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() Seq

func (*PromiseContext) SetError

func (p *PromiseContext) SetError(err error)

func (*PromiseContext) SetReceiver

func (p *PromiseContext) SetReceiver(receiver *aactor.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 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 any) 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 Seq

type Seq = uint64

Jump to

Keyboard shortcuts

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