Sourabh Rawat
class Executor { // private val scope = CoroutineScope(Job() + Executors.newFixedThreadPool(10).asCoroutineDispatcher()) private val context = Executors.newFixedThreadPool(10).asCoroutineDispatcher() suspend fun submit(value: Any) { withContext(context) { logger.debug { "Successfully received: $value" } } } fun stop() { // TODO } }
Dominaezzz
uli
class Executor { // private val scope = CoroutineScope(Job() + Executors.newFixedThreadPool(10).asCoroutineDispatcher()) private val dispatcher = Executors.newFixedThreadPool(10).asCoroutineDispatcher() private val scope = CoroutineScope(Job() + dispatcher) fun submit(value: Any) { scope.launch { logger.debug { "Successfully received: $value" } } } fun stop() { scope.cancel() } }
A modern programming language that makes developers happier.