ipc

package
v0.0.0-...-4ee4993 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const ChannelRPCMain = "rpcMain"
View Source
const Prefix = "golang-msgcomm-"

Variables

This section is empty.

Functions

func EndpointAsStream

func EndpointAsStream(channel string, endpoint Endpoint) io.ReadWriteCloser

func NewClient

func NewClient(channelName string, endpoint Endpoint) *rpc.Client

NewClient creates a new RPC client on the specified endpoint/channel name

func SendChunked

func SendChunked(sender Sender, channel string, msg []byte)

SendChunked sends a message to a specific sender in a chunked format. This allows the sending of enormous messages without overruning potentially small message size limits. Receiving a chunked message requires wrapping a chunked endpoint around the receiving end of the endpoint, via GetChunkedEndpoint(...)

Types

type Endpoint

type Endpoint interface {
	Sender
	Listener
}

func GetChunkedEndpoint

func GetChunkedEndpoint(targetEndpoint Endpoint) Endpoint

GetChunkedEndpoint creates an wrapper around the specified endpoint facilitating the sending and receipt of chunked messages

type Listener

type Listener interface {
	Listen(channelName string) (recv <-chan Message, done func())
}

type Message

type Message interface {
	// Content of the message
	Content() []byte

	// Unique identifer of the message's sender
	Sender() string

	// Send a response back to the sender
	Reply(channelName string, data []byte)

	JSValue() js.Value
}

A message passed between processes

type Sender

type Sender interface {
	Send(channelName string, data []byte)
}

type SequencedMessage

type SequencedMessage struct {
	SequenceNumber int64
	Content        []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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