method

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	MsgType       cproto.MsgType
	RequestGoType reflect.Type
	Protobuf      bool
	Invoke        cfacade.TypedInvoke
}

Handler describes a validated Actor method for mailbox installation.

func AdaptHandler

func AdaptHandler(handler any) (*Handler, error)

AdaptHandler validates handler signatures and returns invoke metadata used by Actor mailboxes to decode raw transport bodies.

type InvokeError

type InvokeError struct {
	Code    cproto.StatusCode
	Message string
}

InvokeError lets an Actor handler return a protocol status instead of the generic STATUS_INTERNAL used for ordinary errors.

func (*InvokeError) Error

func (e *InvokeError) Error() string

Error implements error.

type Table

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

Table is the application-wide MethodID catalog populated by Actor.Methods().Register. A top-level MethodID also records its ActorPath, so ordinary callers only need the MethodID. Body decoding happens in the Actor mailbox.

func NewTable

func NewTable(app cfacade.IApplication) *Table

NewTable creates an empty application-scoped method table.

func (*Table) Dispatch

func (r *Table) Dispatch(ctx *cfacade.RequestContext, methodID uint32, body []byte, msgType cproto.MsgType) *cfacade.InvokeResult

Dispatch validates the registered message type and invokes the top-level Actor selected by MethodID with the raw transport body.

func (*Table) MsgType

func (r *Table) MsgType(methodID uint32) (cproto.MsgType, bool)

MsgType returns the protocol message type inferred from the handler signature.

func (*Table) Register

func (r *Table) Register(methodID uint32, target string, msgType cproto.MsgType) error

Register records one externally routable top-level Actor method. Handler reflection and body decoding remain private to the Actor mailbox.

func (*Table) Target

func (r *Table) Target(methodID uint32) (string, bool)

Target returns the default top-level ActorPath registered for methodID.

func (*Table) UnregisterTarget

func (r *Table) UnregisterTarget(target string)

UnregisterTarget removes catalog entries when a top-level Actor stops.

Jump to

Keyboard shortcuts

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