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

Request a list of tasks with params #41

Merged
merged 3 commits into from Feb 26, 2015
Merged

Conversation

phacops
Copy link
Contributor

@phacops phacops commented Feb 25, 2015

This new method allows to send a request with different params to iron.io's API in order to filter what is returned.

out := map[string][]TaskInfo{}
url := w.tasks()

if params.CodeName != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like code_name parameter, represented by TaskListParams.CodeName, is optional API parameter. Could you please remove the check, that CodeName is empty, and keep just url.QueryAdd(...).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just don't want an empty parameter to be included in the request. That's why I check for emptyness. The request will be fired even if it's empty. I can still remove it though.

By the way, according to the documentation (http://dev.iron.io/worker/reference/api/#list_tasks), it's a required parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just don't want an empty parameter to be included in the request.

what's wrong with empty parameters in request? It is regular case for HTTP. Let worker's API handle all the errors ( ;

it's a required parameter

exactly. But in the client library it looks like optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True.

featalion added a commit that referenced this pull request Feb 26, 2015
Request a list of tasks with params
@featalion featalion merged commit ac66de4 into iron-io:master Feb 26, 2015
@featalion
Copy link
Contributor

Thanks, @phacops !

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.

None yet

2 participants