rclone/vendor/storj.io/drpc/drpcmanager
Caleb Case e7bd392a69 backend/tardigrade: Upgrade to uplink v1.0.6
This fixes an important bug with listing that affects users with more
than 500 objects in a listing operation.
2020-05-29 18:00:08 +01:00
..
doc.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
manager.go backend/tardigrade: Upgrade to uplink v1.0.6 2020-05-29 18:00:08 +01:00
README.md Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00

package drpcmanager

import "storj.io/drpc/drpcmanager"

Package drpcmanager reads packets from a transport to make streams.

Usage

type Manager

type Manager struct {
}

Manager handles the logic of managing a transport for a drpc client or server. It ensures that the connection is always being read from, that it is closed in the case that the manager is and forwarding drpc protocol messages to the appropriate stream.

func New

func New(tr drpc.Transport) *Manager

New returns a new Manager for the transport.

func NewWithOptions

func NewWithOptions(tr drpc.Transport, opts Options) *Manager

NewWithOptions returns a new manager for the transport. It uses the provided options to manage details of how it uses it.

func (*Manager) Close

func (m *Manager) Close() error

Close closes the transport the manager is using.

func (*Manager) Closed

func (m *Manager) Closed() bool

Closed returns if the manager has been closed.

func (*Manager) NewClientStream

func (m *Manager) NewClientStream(ctx context.Context) (stream *drpcstream.Stream, err error)

NewClientStream starts a stream on the managed transport for use by a client.

func (*Manager) NewServerStream

func (m *Manager) NewServerStream(ctx context.Context) (stream *drpcstream.Stream, rpc string, err error)

NewServerStream starts a stream on the managed transport for use by a server. It does this by waiting for the client to issue an invoke message and returning the details.

type Options

type Options struct {
	// WriterBufferSize controls the size of the buffer that we will fill before
	// flushing. Normal writes to streams typically issue a flush explicitly.
	WriterBufferSize int

	// Stream are passed to any streams the manager creates.
	Stream drpcstream.Options
}

Options controls configuration settings for a manager.