Skip to content

Instantly share code, notes, and snippets.

@ellismarte
Last active July 21, 2016 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ellismarte/ca4da72946893a0c6cc2caea40344c9e to your computer and use it in GitHub Desktop.
Save ellismarte/ca4da72946893a0c6cc2caea40344c9e to your computer and use it in GitHub Desktop.
# publish_for_retry({"condition" => message["retry_count"] < 3, "message" => {}})
def publish_for_retry(details)
if details["condition"]
publish(details["message"])
else
yield
end
end
def publish(message)
response = client.send(message)
if response.status == 200
"successful"
else
"error"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment