lib: split kr_resolve code to steps, so it doesn't depend on requestor
Problem
The kr_resolve runs blocks until the resolution is complete. This way we can't resolve queries while possibly long queries are being resolved. The problem is that the code uses requestor in a loop until the resolution is done.
Expected outcome
-
The API should be broken into several phases: init, step, finish
. -
The init
step would take the input query, thestep
would either resolve a query or return the next query that should be sent.-
If the query is resolved, then the caller could finish
the resolution and return answer. -
If not, it should issue the query, save the context and place the socket into the event loop.
-
-
Implement the new API in the daemon event loop. -
Keep multiple requests at once. -
Implement timeouts for the requests.#22 (closed) -
Reimplement iteration limits. -
Implement query deduplication (ID+query)N/A for now
-
This way, we could process multiple queries at once.