jlouis / graphql-erlang

GraphQL implementation in Erlang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrent execution: add timeouts

jlouis opened this issue · comments

Our (experimental) concurrent execution currently waits 750ms for some event to happen. This is arbitrarily chosen and if the deadline is met, we fail the query. We'd like for each defer statement to tell the engine what it expects is the deadline. This will allow us to manage deadlines in the system and run with higher deadlines.

This issue tracks what there is to be done in order to solve this problem.

  • Introduce a deadline timeout to defer results
  • Gather all timeouts, pick the maximal one
  • Handle timeout extension if parts of the query requires a larger timeout
  • Resolve deadlines by removing appropriate closures: invoke an {error, timeout} as the response result and feed that to the closure. It will then resolve itself properly, but as if an error occurred.