internal

package
v0.0.0-...-4624acb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SendChan

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

SendChan is a specialized channel used to implement the asynchronous interface of the MessageClient. SendChan is a MPSC channel.

func NewSendChan

func NewSendChan(cap int64) *SendChan

NewSendChan returns a new SendChan.

func (*SendChan) Receive

func (c *SendChan) Receive(ctx context.Context, tick <-chan time.Time) (*proto.MessageEntry, bool, error)

Receive receives one message from the channel. If a message is received from `tick`, the function will return (nil, false, nil).

func (*SendChan) SendAsync

func (c *SendChan) SendAsync(topic string, value []byte, nextSeq func() int64) (ok bool, seq int64)

SendAsync tries to send a message. If the message is accepted, nextSeq will be called once, and the returned value will be used as the Sequence number of the message.

func (*SendChan) SendSync

func (c *SendChan) SendSync(
	ctx context.Context,
	topic string,
	value []byte,
	closeCh <-chan struct{},
	nextSeq func() int64,
) (int64, error)

SendSync sends a message synchronously.

Jump to

Keyboard shortcuts

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