Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ type ProcessorOptions struct {

### MultiProcessor

`NewMultiProcessor` takes in a list of receivers and a message handler. It creates a processor for each receiver and starts them concurrently.

see [Processor and MultiProcessor examples](v2/processor_test.go)
Deprecated: `NewMultiProcessor`, `ReceiverEx`, and `NewReceiverEx` are deprecated and will be removed in a future version.
Use `NewProcessor` with one receiver per processor instead.

## Middlewares:
GoSHuttle provides a few middleware to simplify the implementation of the message handler in the application code
Expand Down
11 changes: 11 additions & 0 deletions v2/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ type MessageSettler interface {
RenewMessageLock(ctx context.Context, message *azservicebus.ReceivedMessage, options *azservicebus.RenewMessageLockOptions) error
}

// ReceiverEx names a Service Bus receiver for NewMultiProcessor.
//
// Deprecated: NewMultiProcessor is deprecated and will be removed in a future version.
// Use NewProcessor with one receiver per Processor instead.
type ReceiverEx struct { // shuttle.Receiver is already an exported interface
name string
sbReceiver Receiver
}

// NewReceiverEx creates a named receiver for NewMultiProcessor.
//
// Deprecated: NewMultiProcessor is deprecated and will be removed in a future version.
// Use NewProcessor with one receiver per Processor instead.
func NewReceiverEx(name string, sbReceiver Receiver) *ReceiverEx {
return &ReceiverEx{
name: name,
Expand Down Expand Up @@ -124,6 +132,9 @@ func NewProcessor(receiver Receiver, handler HandlerFunc, options *ProcessorOpti
}

// NewMultiProcessor creates a new processor with a list of receivers and a handler.
//
// Deprecated: NewMultiProcessor is deprecated and will be removed in a future version.
// Use NewProcessor with one receiver per Processor instead.
func NewMultiProcessor(receiversEx []*ReceiverEx, handler HandlerFunc, options *ProcessorOptions) *Processor {
opts := applyProcessorOptions(options)
var receivers = make(map[string]*ReceiverEx)
Expand Down
Loading