workerchannel

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// netstring length for a 4194304 bytes payload.
	NS_MESSAGE_MAX_LEN = 4194308
	NS_PAYLOAD_MAX_LEN = 4194304
)
View Source
const (
	UNDEFINED = "undefined"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {

	// handle request message
	OnRequestHandler atomic.Value // func(request RequestData) ResponseData
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(netParser netparser.INetParser, id string, jsonFormat bool) *Channel

func (*Channel) Close

func (c *Channel) Close()

func (*Channel) Event

func (c *Channel) Event(targetId int, event string)

func (*Channel) OnRequest

func (c *Channel) OnRequest(fn func(request RequestData) ResponseData)

type InternalData

type InternalData struct {
	RouterId       string `json:"routerId,omitempty"`
	TransportId    string `json:"transportId,omitempty"`
	ProducerId     string `json:"producerId,omitempty"`
	ConsumerId     string `json:"consumerId,omitempty"`
	DataProducerId string `json:"dataProducerId,omitempty"`
	DataConsumerId string `json:"dataConsumerId,omitempty"`
	RtpObserverId  string `json:"rtpObserverId,omitempty"`
}

func (*InternalData) Unmarshal

func (i *InternalData) Unmarshal(data json.RawMessage) error

type PayloadChannel

type PayloadChannel struct {
}

func NewPayloadChannel

func NewPayloadChannel() *PayloadChannel

type RequestData

type RequestData struct {
	Method   string
	Internal InternalData
	Data     json.RawMessage
}

func (RequestData) String

func (d RequestData) String() string

type ResponseData

type ResponseData struct {
	Err  error
	Data json.RawMessage
}

func (ResponseData) String

func (d ResponseData) String() string

Jump to

Keyboard shortcuts

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