Skip to content

Instantly share code, notes, and snippets.

Juan Ignacio Vimberg jivimberg

Block or report user

Report or block jivimberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jivimberg / CoroutinesUtils.kt
Last active Sep 24, 2019
SQS Consumer using Kotlin coroutines and pool of workers.
View CoroutinesUtils.kt
package com.jivimberg.sqs.published
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.isActive
import kotlinx.coroutines.yield
import java.lang.Thread.currentThread
suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) {
while (isActive) {
You can’t perform that action at this time.