queue

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 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 Message

type Message interface {
	Data() []byte
	Done(context.Context)
	Failed()
	IsExpired() bool
}

Message represents a message from a queue.

type SQS

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

SQS represents a VAA queue in SQS.

func NewVAASQS

func NewVAASQS(producer *sqs.Producer, consumer *sqs.Consumer, logger *zap.Logger, opts ...SQSOption) *SQS

NewVAASQS creates a VAA queue in SQS instances.

func (*SQS) Close

func (q *SQS) Close()

Close closes all consumer resources.

func (*SQS) Consume

func (q *SQS) Consume(ctx context.Context) <-chan Message

Consume returns the channel with the received messages from SQS queue.

func (*SQS) Publish

func (q *SQS) Publish(ctx context.Context, v *vaa.VAA, data []byte) error

Publish sends the message to a SQS queue.

type SQSOption

type SQSOption func(*SQS)

SQSOption represents a VAA queue in SQS option function.

func WithChannelSize

func WithChannelSize(size int) SQSOption

WithChannelSize allows to specify an channel size when setting a value.

type VAAInMemory

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

VAAInMemory represents VAA queue in memory.

func NewVAAInMemory

func NewVAAInMemory(opts ...VAAInMemoryOption) *VAAInMemory

NewVAAInMemory creates a VAA queue in memory instances.

func (*VAAInMemory) Consume

func (i *VAAInMemory) Consume(_ context.Context) <-chan Message

Consume returns the channel with the received messages.

func (*VAAInMemory) Publish

func (i *VAAInMemory) Publish(_ context.Context, v *vaa.VAA, data []byte) error

Publish sends the message to a channel.

type VAAInMemoryOption

type VAAInMemoryOption func(*VAAInMemory)

VAAInMemoryOption represents a VAA queue in memory option function.

func WithSize

func WithSize(v int) VAAInMemoryOption

WithSize allows to specify an channel size when setting a value.

Jump to

Keyboard shortcuts

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