handlers

package
v0.6.1-pre Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NextHandlerNilError error = fmt.Errorf("next handler cannot be nil")

Functions

This section is empty.

Types

type Concurrent

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

Concurrent is a servicebus handler starts concurrent workers processing messages maxConcurrency configures the maximum of concurrent workers started by the handler

func NewConcurrent

func NewConcurrent(maxConcurrency int, next servicebus.Handler) *Concurrent

func (*Concurrent) Handle

func (c *Concurrent) Handle(ctx context.Context, msg *servicebus.Message) error

type DeadlineContext

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

DeadlineContext is a servicebus middleware handler that creates a message context from the incoming context to isolate each message handling sub processes. It adds a deadline equal to `EnqueuedTime + TTL` to the message context if the message TTL is defined. Otherwise no deadline is applied on the message context. The context is canceled once the `next` middleware returns. this implies that no middleware above DeadlineContext can use this context.

func NewDeadlineContext

func NewDeadlineContext(next servicebus.Handler) *DeadlineContext

func (*DeadlineContext) Handle

func (mc *DeadlineContext) Handle(ctx context.Context, msg *servicebus.Message) error

type LockRenewer

type LockRenewer interface {
	RenewLocks(ctx context.Context, messages ...*servicebus.Message) error
}

LockRenewer abstracts the servicebus subscription client where this functionality lives

type PeekLockRenewer

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

PeekLockRenewer starts a background goroutine that renews the message lock at the given interval until Stop() is called or until the passed in context is canceled. it is a pass through handler if the renewalInterval is nil

func NewPeekLockRenewer

func NewPeekLockRenewer(interval *time.Duration, lockrenewer LockRenewer, next servicebus.Handler) *PeekLockRenewer

func (*PeekLockRenewer) Handle

func (plr *PeekLockRenewer) Handle(ctx context.Context, msg *servicebus.Message) error

type ShuttleAdapter

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

ShuttleAdapter wraps a go-shuttle message.Handler in a servicebus.Handler. It allows the consumer to write go-shuttle handler func that uses the go-shuttle semantic and message disposition API

func NewShuttleAdapter

func NewShuttleAdapter(next message.Handler) *ShuttleAdapter

func (*ShuttleAdapter) Handle

func (c *ShuttleAdapter) Handle(ctx context.Context, msg *servicebus.Message) error

Jump to

Keyboard shortcuts

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