yschimke
11/01/2022, 1:56 PMyschimke
11/01/2022, 1:57 PMAaron Todd
11/01/2022, 2:29 PMIn the one place I use it I buffer the whole body before wrapping
I think the rough plan for OkHttp multiplatform JS support would be. omit the streaming data accessors, and only have one providing completed data. String, bytes.Buffering the entire contents of a large response in memory isn't going to work for large/streaming responses. I'd imagine what I'll have to end up doing is creating an async version of Pipe and then maybe wrapping it in sum type we actually expose like:
sealed class ByteStream {
data class Source(val source: okio.Source): ByteStream(), okio.Source by source
data class Streaming(val source: AsyncStream): ByteStream()
}
// convenience functions for most common operations that deal with the variant differences
suspend fun ByteStream.writeToFile(file: File): Unit
suspend fun ByteStream.toByteArray(): ByteArray
suspend fun ByteStream.toBuffer(): okio.Buffer
For JVM/Native it will be relatively simple, just expose the underlying contents of the response as a Source
and have the convenience suspend functions block on <http://Dispatchers.IO|Dispatchers.IO>
. On JS expose an async abstraction that introduces one layer of buffering between the consumer and producer.jessewilson
11/01/2022, 2:56 PMBuffering the entire contents of a large response in memory isn't going to work for large/streaming responses.We might choose to not support these on JS.
Aaron Todd
11/01/2022, 3:13 PMStylianos Gakis
11/04/2022, 4:35 PMKSFunctionDeclaration
which I know I want to call inside of the body of a function I am generating, is there a way for me to do that in a better way that just doing something like this:
fun FileSpec.Builder.foo() {
addImport(ksFunctionDeclaration.packageName.asString() + ksFunctionDeclaration.simpleName.asString())
addFunction(
FunSpec
.builder()
// stuff
.addStatement("${ksFunctionDeclaration.simpleName}()")
.build()
)
}
I feel like I must be missing some part of the API that simplifies this. or am I wrong?jw
11/04/2022, 4:42 PMMemberName
which will hold a reference to a function and automatically emit an import when used with %M
jw
11/04/2022, 4:43 PM%M
are documented on CodeBlock
https://square.github.io/kotlinpoet/1.x/kotlinpoet/kotlinpoet/com.squareup.kotlinpoet/-code-block/index.htmlTadeas Kriz
11/07/2022, 10:32 PMredwood-layout-uiview
not being published to snapshots yet? I'm unable to find it, but I might be looking wrongjw
11/07/2022, 10:33 PMjw
11/07/2022, 10:33 PMTadeas Kriz
11/07/2022, 10:34 PMjw
11/07/2022, 10:43 PMTadeas Kriz
11/08/2022, 2:26 PMjw
11/08/2022, 2:33 PMTadeas Kriz
11/08/2022, 2:36 PMjw
11/08/2022, 2:48 PMTadeas Kriz
11/08/2022, 3:32 PMjw
11/08/2022, 3:39 PMMateu
11/09/2022, 10:23 AM> Task :client:linkPodDebugFrameworkIosArm64
e: Compilation failed: Unbound symbols not allowed
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: presenters/MoleculePresenter.models|4816226463707555740[0]
* Source files:
* Compiler version info: Konan: 1.7.20 / Kotlin: 1.7.20
* Output kind: FRAMEWORK
e: java.lang.AssertionError: Unbound symbols not allowed
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: presenters/MoleculePresenter.models|4816226463707555740[0]
at org.jetbrains.kotlin.ir.util.SymbolTableKt.noUnboundLeft(SymbolTable.kt:1218)
at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:96)
at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment$default(Psi2IrTranslator.kt:75)
at org.jetbrains.kotlin.backend.konan.PsiToIrKt.psiToIr(PsiToIr.kt:187)
at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt:120)
at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt:118)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:94)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:43)
at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:40)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:94)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:37)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:99)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:47)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:79)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:43)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:179)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:412)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$mainNoExitWithGradleRenderer$1.invoke(K2Native.kt:411)
at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:22)
(...)
jw
11/09/2022, 12:40 PMhfhbd
11/09/2022, 2:53 PMjw
11/09/2022, 3:04 PMTroy Perales
11/09/2022, 5:12 PMA MonotonicFrameClock is not available in this CoroutineContext...
crash when I use viewModelScope
to launch Molecule as it is bound to Dispatchers.Main.immediate
. My solve was to simply launch with AndroidUiDispatcher.Main
, since having the ViewModel hold the Presenter is enough to make it survive configuration changes. Am I missing something else here?
2. What is the recommendation for emitting events within a Composable screen (or any view, for that matter)? The snippet has events
as a SharedFlow, but it does not successfully emit an event when I call events.tryEmit(LoginEvent)
and calling emit
directly won’t work outside a coroutine.Landry Norris
11/09/2022, 10:25 PMRyan Woodcock
11/10/2022, 10:33 AMTadeas Kriz
11/10/2022, 11:33 PMjw
11/10/2022, 11:35 PMandrew
11/12/2022, 3:28 AMandrew
11/12/2022, 3:28 AM