-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added poll endpoint for requests that take longer than the threshold
This commit adds a new `/poll` endpoint that accepts a `poll_id` returned from `/feed` and allows you to query for it at a later time. This is useful for **stop** requests or any other request from the redis monitor that takes longer than the default timeout. Since we use redis to cache the result, you can even put the rest service behind a load balancer and not have to worry about which application actually made the request - when it is finished it will be available to the other nodes as well. Also adds a schema validator for future endpoints so we can be sure that the data coming into the res t endpoint is exactly like we expect.
- Loading branch information
Madison Bahmer
committed
Oct 27, 2016
1 parent
73d28a9
commit 5341ec5
Showing
3 changed files
with
164 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"poll_id": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 100, | ||
"description": "The poll id to retrieve" | ||
} | ||
}, | ||
"required": [ | ||
"poll_id" | ||
], | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ | |
HEARTBEAT_TIMEOUT = 120 | ||
DAEMON_THREAD_JOIN_TIMEOUT = 10 | ||
WAIT_FOR_RESPONSE_TIME = 5 | ||
SCHEMA_DIR = 'schemas/' |