{"action":"created","issue":{"url":"https://api.github.com/repos/NEAT-project/neat/issues/107","repository_url":"https://api.github.com/repos/NEAT-project/neat","labels_url":"https://api.github.com/repos/NEAT-project/neat/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/NEAT-project/neat/issues/107/comments","events_url":"https://api.github.com/repos/NEAT-project/neat/issues/107/events","html_url":"https://github.com/NEAT-project/neat/issues/107","id":162944471,"number":107,"title":"Rework resolver and add request callback","user":{"login":"kristrev","id":2025654,"avatar_url":"https://avatars.githubusercontent.com/u/2025654?v=3","gravatar_id":"","url":"https://api.github.com/users/kristrev","html_url":"https://github.com/kristrev","followers_url":"https://api.github.com/users/kristrev/followers","following_url":"https://api.github.com/users/kristrev/following{/other_user}","gists_url":"https://api.github.com/users/kristrev/gists{/gist_id}","starred_url":"https://api.github.com/users/kristrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristrev/subscriptions","organizations_url":"https://api.github.com/users/kristrev/orgs","repos_url":"https://api.github.com/users/kristrev/repos","events_url":"https://api.github.com/users/kristrev/events{/privacy}","received_events_url":"https://api.github.com/users/kristrev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NEAT-project/neat/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/NEAT-project/neat/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/NEAT-project/neat/labels/solution%20to%20everything","name":"solution to everything","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"kristrev","id":2025654,"avatar_url":"https://avatars.githubusercontent.com/u/2025654?v=3","gravatar_id":"","url":"https://api.github.com/users/kristrev","html_url":"https://github.com/kristrev","followers_url":"https://api.github.com/users/kristrev/followers","following_url":"https://api.github.com/users/kristrev/following{/other_user}","gists_url":"https://api.github.com/users/kristrev/gists{/gist_id}","starred_url":"https://api.github.com/users/kristrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristrev/subscriptions","organizations_url":"https://api.github.com/users/kristrev/orgs","repos_url":"https://api.github.com/users/kristrev/repos","events_url":"https://api.github.com/users/kristrev/events{/privacy}","received_events_url":"https://api.github.com/users/kristrev/received_events","type":"User","site_admin":false},"assignees":[{"login":"kristrev","id":2025654,"avatar_url":"https://avatars.githubusercontent.com/u/2025654?v=3","gravatar_id":"","url":"https://api.github.com/users/kristrev","html_url":"https://github.com/kristrev","followers_url":"https://api.github.com/users/kristrev/followers","following_url":"https://api.github.com/users/kristrev/following{/other_user}","gists_url":"https://api.github.com/users/kristrev/gists{/gist_id}","starred_url":"https://api.github.com/users/kristrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristrev/subscriptions","organizations_url":"https://api.github.com/users/kristrev/orgs","repos_url":"https://api.github.com/users/kristrev/repos","events_url":"https://api.github.com/users/kristrev/events{/privacy}","received_events_url":"https://api.github.com/users/kristrev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-06-29T14:46:11Z","updated_at":"2016-07-04T15:54:12Z","closed_at":null,"body":"The resolver currently does not support multiple flows or multiple requests. For example, one instance of the resolver is tied to one callback and one request. This does not work, what we need to is to implement a request queue and then process one request after the other. The function the application/libneat calls will be something like:\r\n\r\n```\r\nneat_resolve(ctx, flow, res_cb) //potentially remove ctx\r\n```\r\n\r\nThis function will initialize the resolver (if not already initialized), add the request to a queue (list) and then start the request (if none is already in progress). After the request is done (in our internal callback), then we will start the second request (if any). If there are no requests available, we will mark that the resolver resources can be freed and free them in the after-callback. If a request is started before the after-callback, the request to free will be removed.\r\n\r\nThe structure of a request will be something like:\r\n\r\n```\r\nstruct neat_resolver_request {\r\n    struct neat_flow *flow;\r\n    neat_resolver_handle_t *cb;\r\n}\r\n```\r\n\r\nThe change should not be very large, but will in particular need some reworking of the init function and where things are stored. An initial suggestion would be something like:\r\n\r\n* Address monitoring should be kept in resolver.\r\n* Server monitoring should be kept in resolver.\r\n* Idle and timeout should be kept in resolver (they are the generic callbacks).\r\n* Most of what is in getaddrinfo() will be private to one request."},"comment":{"url":"https://api.github.com/repos/NEAT-project/neat/issues/comments/230318444","html_url":"https://github.com/NEAT-project/neat/issues/107#issuecomment-230318444","issue_url":"https://api.github.com/repos/NEAT-project/neat/issues/107","id":230318444,"user":{"login":"kristrev","id":2025654,"avatar_url":"https://avatars.githubusercontent.com/u/2025654?v=3","gravatar_id":"","url":"https://api.github.com/users/kristrev","html_url":"https://github.com/kristrev","followers_url":"https://api.github.com/users/kristrev/followers","following_url":"https://api.github.com/users/kristrev/following{/other_user}","gists_url":"https://api.github.com/users/kristrev/gists{/gist_id}","starred_url":"https://api.github.com/users/kristrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kristrev/subscriptions","organizations_url":"https://api.github.com/users/kristrev/orgs","repos_url":"https://api.github.com/users/kristrev/repos","events_url":"https://api.github.com/users/kristrev/events{/privacy}","received_events_url":"https://api.github.com/users/kristrev/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T15:54:12Z","updated_at":"2016-07-04T15:54:12Z","body":"I am also considering storing all handles, pairs, etc. in the neat_resolver_request struct. After scratching my head a bit, I can't find any big reason not to. They are all \"private\" to one DNS lookup. The only thing that might speak against it, at least in my opinion, is that spacing requests out in time might be trickier. However, I think the advantages outweighs this. For example, we can have true async, parallel DNS. No queue or anything."}}
{"actor":{"display_login":"kristrev"}}