Open devaxolotl opened 4 months ago
Hi @devaxolotl! I checked it locally and couldn't reproduce the issue. A couple of requests were completed simultaneously. Please share more details if the problem remains so we can reproduce your case.
Thank you for the reply @nikpachoo, here are more details on what I am trying:
./docker-image-build.sh
docker run -d -p 8080:8080 --name kotlin-compiler-server [id of image]
/api/compiler/run
I set up two REST clientsPOST http://localhost:8080/api/compiler/run
Content-Type: application/json
{
"args": "1 2 3",
"files": [
{
"name": "File.kt",
"text": "fun main() {\n Thread.sleep(5000L)\n\n println(\"5 seconds has passed\")\n}"
}
]
}
In another client I set up this call:
POST http://localhost:8080/api/compiler/run
Content-Type: application/json
{
"args": "1 2 3",
"files": [
{
"name": "File.kt",
"text": "fun main() {\n println(\"second call\")\n}"
}
]
}
I also tried it with a long running call instead of using sleep or timers.
fun main() {
val n = 45
println("Fibonacci $n numbers:")
for (i in 0 until n) {
print(fibonacci(i).toString() + ", ")
}
}
fun fibonacci(n: Int): Int {
return if (n <= 1) {
n
} else {
fibonacci(n - 1) + fibonacci(n - 2)
}
}
I'm trying to set up kotlin-compiler-server but have run into something I don't know how to get past.
I am able to run the server but it looks like it will only process one request at a time. If I send a request that takes 10 seconds and then send another request the second request only starts after the first request completes.
Is this the expected behavior? Is it possible to get it to process multiple requests at the same time?