Documentation
¶
Index ¶
- type JobMarshaller
- type SQSDecoder
- type SQSExtendedQueue
- func (s *SQSExtendedQueue[Job, Message]) Delete(ctx context.Context, jobID string) error
- func (s *SQSExtendedQueue[Job, Message]) Queue(ctx context.Context, job Job) error
- func (s *SQSExtendedQueue[Job, Message]) Read(ctx context.Context, maxJobs int) ([]queuepoller.WithID[Job], error)
- func (s *SQSExtendedQueue[Job, Message]) Release(ctx context.Context, jobID string) error
- type SerializedJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobMarshaller ¶
type JobMarshaller[Job any, Message any] interface { Marshall(job Job) (SerializedJob[Message], error) Unmarshall(SerializedJob[Message]) (Job, error) }
type SQSDecoder ¶
SQSDecoder provides interfaces for working with jobs received over SQS
func NewSQSDecoder ¶
func NewSQSDecoder[Job any, Message any](cfg aws.Config, bucket string, marshaller JobMarshaller[Job, Message]) *SQSDecoder[Job, Message]
NewSQSDecoder returns a new decoder for the given AWS config
func (*SQSDecoder[Job, Message]) DecodeMessage ¶
func (s *SQSDecoder[Job, Message]) DecodeMessage(ctx context.Context, receiptHandle string, messageBody string) (queuepoller.WithID[Job], error)
DecodeMessage decodes a provider caching job from the SQS message body, reading the stored index from S3
type SQSExtendedQueue ¶
SQSExtendedQueue implements a queue interface using SQS that can store extended data to an S3 bucket
func NewSQSExtendedQueue ¶
func NewSQSExtendedQueue[Job any, Message any](cfg aws.Config, queueID string, bucket string, marshaller JobMarshaller[Job, Message]) *SQSExtendedQueue[Job, Message]
NewSQSExtendedQueue returns a new SQSExtendedQueue for the given aws config
func (*SQSExtendedQueue[Job, Message]) Delete ¶
func (s *SQSExtendedQueue[Job, Message]) Delete(ctx context.Context, jobID string) error
Delete deletes a job message from the SQS queue.
func (*SQSExtendedQueue[Job, Message]) Queue ¶
func (s *SQSExtendedQueue[Job, Message]) Queue(ctx context.Context, job Job) error
Queue implements blobindexlookup.CachingQueue.
func (*SQSExtendedQueue[Job, Message]) Read ¶
func (s *SQSExtendedQueue[Job, Message]) Read(ctx context.Context, maxJobs int) ([]queuepoller.WithID[Job], error)
Read reads a batch of jobs from the SQS queue. Returns an empty slice if no jobs are available. The caller must process jobs and delete them from the queue when done.