Remove removes a queue from the client, stopping the producer if the client is running. It waits for any jobs currently being worked in the queue to complete before returning. If the provided context is done before the producer has fully stopped, Remove returns the context's error and does not full
(ctx context.Context, queueName string)
| 2977 | // Returns an error if the client is not configured to execute jobs or if the |
| 2978 | // specified queue does not exist. |
| 2979 | func (b *QueueBundle) Remove(ctx context.Context, queueName string) error { |
| 2980 | if !b.clientWillExecuteJobs { |
| 2981 | return errors.New("client is not configured to execute jobs, cannot remove queue") |
| 2982 | } |
| 2983 | |
| 2984 | b.startStopMu.Lock() |
| 2985 | defer b.startStopMu.Unlock() |
| 2986 | |
| 2987 | return b.producerRemove(ctx, queueName) |
| 2988 | } |
| 2989 | |
| 2990 | // Generates a default client ID using the current hostname and time. |
| 2991 | func defaultClientID(startedAt time.Time) string { |