{"action":"created","issue":{"url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/412","repository_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java","labels_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/412/labels{/name}","comments_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/412/comments","events_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/412/events","html_url":"https://github.com/Grover-c13/PokeGOAPI-Java/issues/412","id":168546120,"number":412,"title":"[QUESTION] Static wait vs max requests per seconds?","user":{"login":"Sadye","id":6737880,"avatar_url":"https://avatars.githubusercontent.com/u/6737880?v=3","gravatar_id":"","url":"https://api.github.com/users/Sadye","html_url":"https://github.com/Sadye","followers_url":"https://api.github.com/users/Sadye/followers","following_url":"https://api.github.com/users/Sadye/following{/other_user}","gists_url":"https://api.github.com/users/Sadye/gists{/gist_id}","starred_url":"https://api.github.com/users/Sadye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sadye/subscriptions","organizations_url":"https://api.github.com/users/Sadye/orgs","repos_url":"https://api.github.com/users/Sadye/repos","events_url":"https://api.github.com/users/Sadye/events{/privacy}","received_events_url":"https://api.github.com/users/Sadye/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-01T00:11:08Z","updated_at":"2016-08-01T13:50:33Z","closed_at":null,"body":"**Description:**\r\nCurrently in the code there's a static wait of 350 ms between requests, or if there are no requests just a repeated 350 ms wait. [Link](https://github.com/Grover-c13/PokeGOAPI-Java/blob/Development/src/main/java/com/pokegoapi/main/RequestHandler.java#L276)\r\n\r\nWhat are long term plans for this? Calculating how many requests have been done in the past `n` seconds and then (depending on the result) immediately sending a request if available or waiting for the second to pass. (this could be done with a queue I reckon, where the last 3 requests are stored and their time. Some `Thread.sleep(1)` and popping and pushing should then give the desired outcome).\r\n\r\nI'm very happy it works right now, but just wondering. It seems so inefficient."},"comment":{"url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/comments/236585773","html_url":"https://github.com/Grover-c13/PokeGOAPI-Java/issues/412#issuecomment-236585773","issue_url":"https://api.github.com/repos/Grover-c13/PokeGOAPI-Java/issues/412","id":236585773,"user":{"login":"Sadye","id":6737880,"avatar_url":"https://avatars.githubusercontent.com/u/6737880?v=3","gravatar_id":"","url":"https://api.github.com/users/Sadye","html_url":"https://github.com/Sadye","followers_url":"https://api.github.com/users/Sadye/followers","following_url":"https://api.github.com/users/Sadye/following{/other_user}","gists_url":"https://api.github.com/users/Sadye/gists{/gist_id}","starred_url":"https://api.github.com/users/Sadye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sadye/subscriptions","organizations_url":"https://api.github.com/users/Sadye/orgs","repos_url":"https://api.github.com/users/Sadye/repos","events_url":"https://api.github.com/users/Sadye/events{/privacy}","received_events_url":"https://api.github.com/users/Sadye/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T13:50:32Z","updated_at":"2016-08-01T13:50:32Z","body":"I might do that sometime in the future. Not too confident as of now, since I've never worked with either Futures or Observables."}}
{"actor":{"display_login":"Sadye"}}