muxconn

package
v0.0.0-...-c1f2aa7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("connection closed")

Functions

This section is empty.

Types

type Conn

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

Conn implements drpc.Conn using the yamux multiplexer to allow concurrent RPCs

func New

func New(conn io.ReadWriteCloser) (*Conn, error)

New returns a new multiplexed DRPC connection

func (*Conn) Close

func (m *Conn) Close() error

Close closes the multiplexer session and the underlying connection.

func (*Conn) Closed

func (m *Conn) Closed() <-chan struct{}

Closed returns a channel that will be closed when the connection is closed

func (*Conn) Invoke

func (m *Conn) Invoke(ctx context.Context, rpc string, enc drpc.Encoding, in, out drpc.Message) error

Invoke issues the rpc on the transport serializing in, waits for a response, and deserializes it into out.

func (*Conn) NewStream

func (m *Conn) NewStream(ctx context.Context, rpc string, enc drpc.Encoding) (drpc.Stream, error)

NewStream begins a streaming rpc on the connection.

Jump to

Keyboard shortcuts

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