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

Add a flush mechanism #9

Merged
merged 2 commits into from
Feb 6, 2015
Merged

Add a flush mechanism #9

merged 2 commits into from
Feb 6, 2015

Conversation

jkodumal
Copy link
Contributor

@jkodumal jkodumal commented Feb 6, 2015

No description provided.

@@ -39,30 +39,35 @@ def initialize(api_key, config = Config.default)
@worker = create_worker()
end

def flush()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may cause thread-safety issues if there is a regularly-scheduled flush happening at the same time as a manual flush.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Changed so that we handle the case where the pop method has fewer elements than we expect. The underlying queue is thread-safe, so the rest of this should be ok.

@pkaeding
Copy link
Contributor

pkaeding commented Feb 6, 2015

lgtm

jkodumal added a commit that referenced this pull request Feb 6, 2015
@jkodumal jkodumal merged commit 2014be9 into master Feb 6, 2015
@jkodumal jkodumal deleted the jko/flush branch February 6, 2015 23:58
zsiddique added a commit that referenced this pull request Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants