RadicalZephyr / comic-reader

Clojure/Clojurescript single-page app for reading comics
Eclipse Public License 1.0
3 stars 0 forks source link

Fix heroku API timeout on comics list call #22

Open RadicalZephyr opened 8 years ago

RadicalZephyr commented 8 years ago

Basically need to split the query into a kick-off call, and then a polling call. The kick-off generates a token to be used with the polling call, and then the client polls that URL until that data is available. Probably should do this with all the API's that fetch data from the comic sites.

RadicalZephyr commented 7 years ago

Here's a useful resource on doing the RESTful mechanics of doing this API splitting.

http://restcookbook.com/Resources/asynchroneous-operations/

RadicalZephyr commented 7 years ago

Partially fixed, but in a hacky way. By special casing the comics list and caching it in memory and fetching it asynchronously in a future.

It would be cleaner to do the caching at the repo level, and it would be more meaningful for the repository to always return a promise chan or something and then the web app could have every api uniformly return results but only if they're delivered within a short timeout.