This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.runBlocking | |
import java.util.concurrent.atomic.AtomicInteger | |
interface Flow<out T> { | |
suspend fun collect(collector: FlowCollector<T>) | |
} | |
fun interface FlowCollector<in T> { | |
suspend fun emit(value: T) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("UNCHECKED_CAST") | |
package circlet.platform.server.application | |
import java.util.concurrent.atomic.* | |
class BusyWaitSingleton<T>(private val factory: () -> T) { | |
private val value = AtomicReference<State>(State.Empty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlinx.coroutines.CoroutineName | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.runBlocking | |
import kotlinx.coroutines.withContext | |
import kotlin.random.Random | |
suspend fun build(): () -> Unit { | |
val number = Random(239).nextInt() | |
return withContext<() -> Unit>(CoroutineName("produce value")) { | |
delay(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def bootstrap-invoke | |
'(fn | |
[^java.lang.invoke.MethodHandles$Lookup caller | |
^String methodName | |
^java.lang.invoke.MethodType methodType | |
^String varName] | |
(do | |
(when (nil? huj.SampleNS/var_x_var) | |
(set! huj.SampleNS/var_x_var | |
(clojure.lang.Var. huj.SampleNS/ns (clojure.lang.Symbol/intern varName)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clojure.tools.emitter.temp | |
(:refer-clojure :exclude | |
[eval macroexpand-1 macroexpand load]) | |
(:require [clojure.tools.analyzer.jvm :as a] | |
[clojure.tools.emitter.jvm :as j] | |
[clojure.tools.analyzer :refer [macroexpand-1 macroexpand]] | |
[clojure.tools.analyzer.passes :refer [schedule]] | |
[clojure.tools.analyzer.env :as env] | |
[clojure.tools.analyzer.utils :refer [mmerge]] | |
[clojure.tools.emitter.jvm.emit :as e] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Suppress("KDocMissingDocumentation") | |
import io.ktor.client.HttpClient | |
import io.ktor.client.engine.apache.Apache | |
import io.ktor.client.request.get | |
import kotlinx.coroutines.Runnable | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.runBlocking | |
import java.util.concurrent.ThreadFactory | |
import java.util.concurrent.TimeUnit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sandbox | |
import jetbrains.exodus.entitystore.PersistentEntityStoreImpl | |
import jetbrains.exodus.env.EnvironmentConfig | |
import jetbrains.exodus.env.EnvironmentImpl | |
import jetbrains.exodus.env.Environments | |
import jetbrains.exodus.io.FileDataReader | |
import jetbrains.exodus.log.LogConfig | |
import kotlinx.coroutines.experimental.future.await | |
import kotlinx.coroutines.experimental.runBlocking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sandbox | |
import jetbrains.exodus.io.Block | |
import jetbrains.exodus.io.DataReader | |
import jetbrains.exodus.io.FileDataReader | |
import jetbrains.exodus.io.RemoveBlockType | |
import jetbrains.exodus.log.Log | |
import jetbrains.exodus.log.LogUtil | |
import mu.KLogging | |
import software.amazon.awssdk.core.AwsRequestOverrideConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class SuspendAwareThrowable(message: String?) : Throwable(message) { | |
companion object : KLogging() | |
private val _cause = AtomicReference<Throwable>(null) | |
override fun fillInStackTrace(): Throwable { | |
return if (logger.isDebugEnabled) { | |
super.fillInStackTrace() | |
} else { | |
this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias LArray1 = Array<LongArray?> | |
typealias LArray2 = Array<LArray1?> | |
typealias LArray3 = Array<LArray2?> | |
typealias LArray4 = Array<LArray3?> | |
typealias LArray5 = Array<LArray4?> | |
typealias LArray6 = Array<LArray5?> | |
@Suppress("ConvertTwoComparisonsToRangeCheck") | |
class LongBitTree : Iterable<Long> { | |
@Suppress("NOTHING_TO_INLINE") |
NewerOlder