Details
Description
Currently, when submitting statements for execution, the session code does this:
val future = Future { val id = client.submitReplCode(content.code) info(s"Running statement $id: ${content.code}") waitForStatement(id) }
waitForStatement calls itself recursively until the statement is finished; that means that a thread in the global pool will be blocked until that statement finishes, which is bad and limits how many statements can be submitted concurrently.
We either should make the polling a recurring task (instead of a blocking task), or make the monitoring asynchronous.