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

Consistent API #25

Merged
merged 8 commits into from
Mar 10, 2017
Merged

Consistent API #25

merged 8 commits into from
Mar 10, 2017

Conversation

ono
Copy link
Contributor

@ono ono commented Mar 9, 2017

This PR attempts to fix inconsistency on TaskBunny API.

Here is the basic rule:

  • functions to return value or nil: value | nil
  • functions to return value or error information: {:ok, value} | {:error, error_info}
  • functions to return no value or error information: :ok | {:error, error_info}
  • functions with ! at the end: raises an exception for the possible errors

Also changed the followings at the same time:

  • Rename Connection.monitor_connection to Connection.subscribe_connection
  • Extract Job.enqueue as module function so you can enqueue a job without the job module
  • Defined some errors.

Copy link
Contributor

@IanLuites IanLuites left a comment

Choose a reason for hiding this comment

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

👍 very nice! Like the new uniformity!

:exit, e ->
# Handles the error but we carry on...
# It's highly likely caused by the options on queue declare don't match.
# e.g. retry interbval a.k.a message ttl in retry queue
Copy link
Contributor

Choose a reason for hiding this comment

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

interbval => interval (not that important)

@ono ono merged commit f36b47f into master Mar 10, 2017
@ono ono deleted the feature/consistent-api branch March 10, 2017 10:54
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