Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsqd: empty queue does not empty deferred/inflight #144

Merged
merged 1 commit into from
Feb 5, 2013

Conversation

mreiferson
Copy link
Member

nsqd should empty all the internal queues for a channel including in-flight and deferred.

cc @bitly/nsq

@mreiferson
Copy link
Member Author

diff is a little ugly... didn't really see the advantage of having things in queue.go but I'm open to feedback. Topic and channels need to implement empty a little differently and there aren't manning callers of empty anyway...

ready for review @jehiah

// Deferred implements the Queue interface
func (c *Channel) Deferred() map[nsq.MessageID]*pqueue.Item {
return c.deferredMessages
func (c *Channel) Flush() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's comment to give a little context for this function (and why the pq's are not drained). Also, since this function is only used internally, we don't need to export it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@mreiferson
Copy link
Member Author

updated @jehiah

@jehiah
Copy link
Member

jehiah commented Feb 5, 2013

LGTM. squash please

@mreiferson
Copy link
Member Author

squashed

jehiah added a commit that referenced this pull request Feb 5, 2013
nsqd: empty queue does not empty deferred/inflight
@jehiah jehiah merged commit a054ba5 into nsqio:master Feb 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants