{"action":"created","issue":{"url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/625","repository_url":"https://api.github.com/repos/tatsuhiro-t/aria2","labels_url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/625/labels{/name}","comments_url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/625/comments","events_url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/625/events","html_url":"https://github.com/tatsuhiro-t/aria2/issues/625","id":148321832,"number":625,"title":"JSON-RPC batch and system.multicall","user":{"login":"sonnyp","id":19673,"avatar_url":"https://avatars.githubusercontent.com/u/19673?v=3","gravatar_id":"","url":"https://api.github.com/users/sonnyp","html_url":"https://github.com/sonnyp","followers_url":"https://api.github.com/users/sonnyp/followers","following_url":"https://api.github.com/users/sonnyp/following{/other_user}","gists_url":"https://api.github.com/users/sonnyp/gists{/gist_id}","starred_url":"https://api.github.com/users/sonnyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonnyp/subscriptions","organizations_url":"https://api.github.com/users/sonnyp/orgs","repos_url":"https://api.github.com/users/sonnyp/repos","events_url":"https://api.github.com/users/sonnyp/events{/privacy}","received_events_url":"https://api.github.com/users/sonnyp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-14T10:48:19Z","updated_at":"2016-04-14T15:41:13Z","closed_at":null,"body":"I want to add a batch/multicall helper to aria2.js https://github.com/sonnyp/aria2.js/issues/10 and I have a few questions\r\n\r\n1) By reading aria2 code/documentation it's unclear to me if there are conceptual/functional differences between the two or if system.multicall is simply batch for XML-RPC.\r\n\r\n2) In the case there is no differences, should I prefer JSON-RPC batch over multicall?\r\n\r\n> The secret token validation in aria2 is designed to take at least a certain amount of time to mitigate brute-force/dictionary attacks against the RPC interface. Therefore it is recommended to prefer Batch or system.multicall requests when appropriate. \r\n\r\n3) I don't follow the conclusion of the first sentence? Does it mean using batch/multicall is a way to reduce 'flooding' so that the brute-force/dictionary attack protection doesn't kick off for a large number of requests? What is the rate limit?\r\n\r\n4) Does it mean batch/multicall should always be preferred over multiple requests? Even for WebSocket transport?\r\n\r\nI'll be happy to send a documentation PR and see if I can clarify those points with your help."},"comment":{"url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/comments/210008371","html_url":"https://github.com/tatsuhiro-t/aria2/issues/625#issuecomment-210008371","issue_url":"https://api.github.com/repos/tatsuhiro-t/aria2/issues/625","id":210008371,"user":{"login":"tatsuhiro-t","id":404610,"avatar_url":"https://avatars.githubusercontent.com/u/404610?v=3","gravatar_id":"","url":"https://api.github.com/users/tatsuhiro-t","html_url":"https://github.com/tatsuhiro-t","followers_url":"https://api.github.com/users/tatsuhiro-t/followers","following_url":"https://api.github.com/users/tatsuhiro-t/following{/other_user}","gists_url":"https://api.github.com/users/tatsuhiro-t/gists{/gist_id}","starred_url":"https://api.github.com/users/tatsuhiro-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tatsuhiro-t/subscriptions","organizations_url":"https://api.github.com/users/tatsuhiro-t/orgs","repos_url":"https://api.github.com/users/tatsuhiro-t/repos","events_url":"https://api.github.com/users/tatsuhiro-t/events{/privacy}","received_events_url":"https://api.github.com/users/tatsuhiro-t/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T15:41:12Z","updated_at":"2016-04-14T15:41:12Z","body":"aria2 RPC response is supposed to be non-blocking, and it means it should be done 'quickly'. If you really need super fast response for a single request, regular non-batch RPC may be faster.  But unless you pack hundreds of RPC requests in a single batch, the difference may not be noticeable.\r\n\r\nWith low latency, yes, there may be no difference at all.  But in these days, everyone uses mobile, right?  Probably it is not the use case of your js lib, though.\r\n\r\n"}}