chans

package
v0.8.32 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultChanBufferSize is the default buffer size for
	// underlying Go channels used by some Chans.
	DefaultChanBufferSize = 1024
)

Functions

func NewSQSChan

func NewSQSChan(ctx *dsl.Ctx, o interface{}) (dsl.Chan, error)

Types

type SQSChan

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

SQSChan is an SQS consumer/producer.

In this implementation, message and subscription topics are ignored.

func (*SQSChan) Close

func (c *SQSChan) Close(ctx *dsl.Ctx) error

func (*SQSChan) Consume

func (c *SQSChan) Consume(ctx *dsl.Ctx)

func (*SQSChan) DocSpec

func (c *SQSChan) DocSpec() *dsl.DocSpec

func (*SQSChan) Kill

func (c *SQSChan) Kill(ctx *dsl.Ctx) error

func (*SQSChan) Kind

func (c *SQSChan) Kind() dsl.ChanKind

func (*SQSChan) Open

func (c *SQSChan) Open(ctx *dsl.Ctx) error

func (*SQSChan) Pub

func (c *SQSChan) Pub(ctx *dsl.Ctx, m dsl.Msg) error

func (*SQSChan) Recv

func (c *SQSChan) Recv(ctx *dsl.Ctx) chan dsl.Msg

func (*SQSChan) Sub

func (c *SQSChan) Sub(ctx *dsl.Ctx, topic string) error

func (*SQSChan) To

func (c *SQSChan) To(ctx *dsl.Ctx, m dsl.Msg) error

type SQSOpts

type SQSOpts struct {
	// Endpoint is optional AWS service endpoint, which can be
	// provided to point to a non-standard endpoint (like a local
	// implementation).
	Endpoint string `json:"Endpoint"` // Will eventually move to all lower-case.

	// QueueURL is the target SQS queue URL.
	QueueURL string

	// DelaySeconds is the publishing delay in seconds.
	//
	// Defaults to zero.
	DelaySeconds int64

	// VisibilityTimeout is the default timeout for a message
	// reappearing after a receive operation and before a delete
	// operation.  Defaults to 10 seconds.
	VisibilityTimeout int64

	// MaxMessages is the maximum number of message to request.
	//
	// Defaults to 1.
	MaxMessages int

	// DoNotDelete turns off automatic message deletion upon receipt.
	DoNotDelete bool

	// BufferSize is the size of the underlying channel buffer.
	// Defaults to DefaultChanBufferSize.
	BufferSize int

	// MsgDelaySeconds enables extraction of property DelaySeconds
	// from published message's payload, which should be a JSON of
	// an map.
	//
	// This hack means that a test cannot specify DelaySeconds for
	// a payload that is not a JSON representation of a map.
	// ToDo: Reconsider.
	MsgDelaySeconds bool

	// WaitTimeSeconds is the SQS receive wait time.
	//
	// Defaults to one second.
	WaitTimeSeconds int64
}

SQSOpts configures an SQS consumer/producer.

For now, the target queue URL is provided when the channel is created. Eventually perhaps the queue URL could be the message/subscription topic.

Jump to

Keyboard shortcuts

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