stream

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FAILED = protocol.FAILED
	EAGAIN = protocol.EAGAIN
)

alias for compatible

Functions

func SelectStreamFactoryProtocol

func SelectStreamFactoryProtocol(ctx context.Context, prot string, peek []byte, scopes []api.ProtocolName) (types.ProtocolName, error)

Types

type BaseStream

type BaseStream struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*BaseStream) AddEventListener

func (s *BaseStream) AddEventListener(streamCb types.StreamEventListener)

func (*BaseStream) DestroyStream

func (s *BaseStream) DestroyStream()

func (*BaseStream) RemoveEventListener

func (s *BaseStream) RemoveEventListener(streamCb types.StreamEventListener)

func (*BaseStream) ResetStream

func (s *BaseStream) ResetStream(reason types.StreamResetReason)

type Client

type Client interface {
	api.ConnectionEventListener
	api.ReadFilter

	ConnID() uint64

	Connect() error

	ActiveRequestsNum() int

	NewStream(context context.Context, respDecoder types.StreamReceiveListener) types.StreamSender

	SetConnectionCollector(read, write metrics.Counter)

	AddConnectionEventListener(listener api.ConnectionEventListener)

	SetStreamConnectionEventListener(listener types.StreamConnectionEventListener)

	Close()
}

func NewBiDirectStreamClient

func NewBiDirectStreamClient(ctx context.Context, prot api.ProtocolName, connection types.ClientConnection, host types.Host,
	serverCallbacks types.ServerStreamConnectionEventListener) Client

NewBiDirectStreamClient Create a bidirectional client used to realize bidirectional communication

func NewStreamClient

func NewStreamClient(ctx context.Context, prot api.ProtocolName, connection types.ClientConnection, host types.Host) Client

NewStreamClient Create a codecclient used as a client to send/receive stream in a connection

type ContextManager

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

contextManager

func NewContextManager

func NewContextManager(base context.Context) *ContextManager

func (*ContextManager) Get

func (cm *ContextManager) Get() context.Context

func (*ContextManager) InjectTrace

func (cm *ContextManager) InjectTrace(ctx context.Context, span api.Span) context.Context

func (*ContextManager) Next

func (cm *ContextManager) Next()

type StreamDirection added in v0.11.0

type StreamDirection int

StreamDirection represent the stream's direction

const (
	ServerStream StreamDirection = 1
	ClientStream StreamDirection = 0
)

ServerStream = 1 ClientStream = 0

Directories

Path Synopsis
connpool
msgconnpool
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.

Jump to

Keyboard shortcuts

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