Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream response from Judge0 #451

Open
davejohnston opened this issue Jan 23, 2024 · 0 comments
Open

Stream response from Judge0 #451

davejohnston opened this issue Jan 23, 2024 · 0 comments

Comments

@davejohnston
Copy link

Hi I've been working with Judge0 and trying to see if its possible to stream the output of some code, rather than wait for the application to timeout.

i.e the following application loops through the array, printing the result. It has a 1 second sleep between each iteration.

package main

import "fmt"
import "time"

func main() {

  nums := []int{2, 3, 4}
    sum := 0
    for _, num := range nums {
        sum += num
        fmt.Println("sum:", sum)
        time.Sleep(1*time.Second)
    }
   
}

When I try this on https://ide.judge0.com/ it only prints the output at the very end (i.e after the application completes). When self hosting judge0, is it possible to set a config option to allow it to stream back the output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant