Documentation
¶
Index ¶
- type AckSender
- type Broker
- func (b *Broker) AttachStreamWriter(meta *wshrpc.StreamMeta, writer StreamWriter) error
- func (b *Broker) Close()
- func (b *Broker) CreateStreamReader(readerRoute string, writerRoute string, rwnd int64) (*Reader, *wshrpc.StreamMeta)
- func (b *Broker) CreateStreamReaderWithSeq(readerRoute string, writerRoute string, rwnd int64, startSeq int64) (*Reader, *wshrpc.StreamMeta)
- func (b *Broker) CreateStreamWriter(meta *wshrpc.StreamMeta) (*Writer, error)
- func (b *Broker) DetachStreamWriter(streamId string)
- func (b *Broker) RecvAck(ackPk wshrpc.CommandStreamAckData)
- func (b *Broker) RecvData(dataPk wshrpc.CommandStreamData)
- func (b *Broker) SendAck(ackPk wshrpc.CommandStreamAckData)
- func (b *Broker) SendData(dataPk wshrpc.CommandStreamData)
- type DataSender
- type Reader
- type StreamRpcInterface
- type StreamWriter
- type Writer
- func (w *Writer) Close() error
- func (w *Writer) CloseWithError(err error) error
- func (w *Writer) GetAckState() (maxAckedSeq int64, finAcked bool, canceled bool)
- func (w *Writer) GetCanceledChan() <-chan struct{}
- func (w *Writer) RecvAck(ackPk wshrpc.CommandStreamAckData)
- func (w *Writer) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckSender ¶
type AckSender interface {
SendAck(ackPk wshrpc.CommandStreamAckData)
}
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func NewBroker ¶
func NewBroker(rpcClient StreamRpcInterface) *Broker
func (*Broker) AttachStreamWriter ¶
func (b *Broker) AttachStreamWriter(meta *wshrpc.StreamMeta, writer StreamWriter) error
func (*Broker) CreateStreamReader ¶
func (*Broker) CreateStreamReaderWithSeq ¶
func (*Broker) CreateStreamWriter ¶
func (b *Broker) CreateStreamWriter(meta *wshrpc.StreamMeta) (*Writer, error)
func (*Broker) DetachStreamWriter ¶
func (*Broker) RecvAck ¶
func (b *Broker) RecvAck(ackPk wshrpc.CommandStreamAckData)
func (*Broker) RecvData ¶
func (b *Broker) RecvData(dataPk wshrpc.CommandStreamData)
RecvData and RecvAck are designed to be non-blocking and must remain so to prevent deadlock. They only enqueue work items to be processed asynchronously by the work queue's goroutine. These methods are called from the main RPC runServer loop, so blocking here would stall all RPC processing.
func (*Broker) SendAck ¶
func (b *Broker) SendAck(ackPk wshrpc.CommandStreamAckData)
func (*Broker) SendData ¶
func (b *Broker) SendData(dataPk wshrpc.CommandStreamData)
type DataSender ¶
type DataSender interface {
SendData(dataPk wshrpc.CommandStreamData)
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReaderWithSeq ¶
func (*Reader) RecvData ¶
func (r *Reader) RecvData(dataPk wshrpc.CommandStreamData)
func (*Reader) UpdateNextSeq ¶
type StreamRpcInterface ¶
type StreamRpcInterface interface {
StreamDataAckCommand(data wshrpc.CommandStreamAckData, opts *wshrpc.RpcOpts) error
StreamDataCommand(data wshrpc.CommandStreamData, opts *wshrpc.RpcOpts) error
}
type StreamWriter ¶
type StreamWriter interface {
RecvAck(ackPk wshrpc.CommandStreamAckData)
}
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) Close ¶
If Close() is called while a Write is blocked, the Write will return an error and buffered data may be discarded.
func (*Writer) CloseWithError ¶
If CloseWithError() is called while a Write is blocked, the Write will return an error and buffered data may be discarded.
func (*Writer) GetAckState ¶
func (*Writer) GetCanceledChan ¶
func (w *Writer) GetCanceledChan() <-chan struct{}
func (*Writer) RecvAck ¶
func (w *Writer) RecvAck(ackPk wshrpc.CommandStreamAckData)
Click to show internal directories.
Click to hide internal directories.