mirror of
https://github.com/oarkflow/mq.git
synced 2025-09-27 04:15:52 +08:00
feat: implement Validate
to check for cycle
This commit is contained in:
@@ -232,7 +232,14 @@ func (c *Consumer) Consume(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.pool = NewPool(c.opts.numOfWorkers, c.opts.queueSize, c.opts.maxMemoryLoad, c.ProcessTask, c.OnResponse, c.opts.storage)
|
||||
c.pool = NewPool(
|
||||
c.opts.numOfWorkers,
|
||||
WithTaskQueueSize(c.opts.queueSize),
|
||||
WithMaxMemoryLoad(c.opts.maxMemoryLoad),
|
||||
WithHandler(c.ProcessTask),
|
||||
WithPoolCallback(c.OnResponse),
|
||||
WithTaskStorage(c.opts.storage),
|
||||
)
|
||||
if err := c.subscribe(ctx, c.queue); err != nil {
|
||||
return fmt.Errorf("failed to connect to server for queue %s: %v", c.queue, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user