tuxji commented on code in PR #879:
URL: https://github.com/apache/daffodil/pull/879#discussion_r1063639451
##########
daffodil-lib/src/main/scala/org/apache/daffodil/util/Coroutines.scala:
##########
@@ -20,10 +20,25 @@
import org.apache.daffodil.exceptions.UnsuppressableException
import java.util.concurrent.ArrayBlockingQueue
+ import java.util.concurrent.Executors
+
+ import scala.concurrent.ExecutionContext
+ import scala.concurrent.Future
import scala.util.Failure
import scala.util.Success
import scala.util.Try
+ object Coroutine {
+ val executionContext = new ExecutionContext {
+ private val threadPool = Executors.newCachedThreadPool()
+ def execute(runnable: Runnable): Unit = threadPool.submit(runnable)
Review Comment:
I didn't know we add only 1 extra thread per SAX unparse call anyway, which
is only going to double the total number of threads, not increase the number of
threads exponentially. No, we don't need to allow callers to pass in an
execution context. I agree it's really on the users to limit their calls if
they use Daffodil as a server and make as many SAX unparse calls as there are
connections from client machines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]