We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
In this Stack Overflow question, we found that the problem experienced occurs in the Scastie playground but not locally.
i.e. this code hangs indefinitely:
import java.io._ import scala.io.Source import scala.concurrent._ import scala.concurrent.ExecutionContext.Implicits.global def copy(inputStream: InputStream, outputStream: OutputStream): Unit = { val buffer = new Array[Byte](1024) var bytesRead = inputStream.read(buffer) while (bytesRead != -1) { outputStream.write(buffer, 0, bytesRead) bytesRead = inputStream.read(buffer) } outputStream.flush() } val os0 = new PipedOutputStream val is0 = new PipedInputStream(os0) val os1 = new PipedOutputStream val is1 = new PipedInputStream(os1) // write to os0 Future { os0.write(("foobarbaz"*1000).getBytes("utf-8")) os0.close() } // copy is0 to os1 Future { copy(is0, os1) os1.close() } // read is1 to output val result = Source.fromInputStream(is1).mkString println(result)
Does scastie handle Futures / multiple threads in some unusual way?
Future
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In this Stack Overflow question, we found that the problem experienced occurs in the Scastie playground but not locally.
i.e. this code hangs indefinitely:
Does scastie handle
Future
s / multiple threads in some unusual way?The text was updated successfully, but these errors were encountered: