Clocks
03/08/2021, 4:16 AMKamilH
03/10/2021, 8:44 AMInvalidMutabilityException
when launching new coroutine on Main Dispatcher (code in thread).KamilH
03/12/2021, 4:42 PMcoroutines
library, because I think it’s a way most of us doing background job in KN. There are a lot of articles that are trying to explain concurrency topic and this is great. However at the end of the day when you are starting to work with it, you implement simple class that keeps state, state is getting accessed in background thread and you are getting InvalidMutabilityException
. When I get this the only easy way to work around this was to use “AtomicReference”, but later I started thinking if it’s the best solution and it is really not obvious to answers.
Some questions, that it would be great to know answers to:
• How to implement simple in memory cache? With and without Map
(with one value that is nullable and with Map<V,K>
)?
• How to implement a class that does something, keeps internal state, but we don’t know on what thread it is going to be used?
• For collections that keeps state, should we use IsoMutableList
or MutableList<AtomicReference>
? Will they work similarly? What are the performance implications?
• Is StateFlow
useful when it’s about keeping a state?joshshin
03/12/2021, 11:50 PMfreeze
on a CompletableDeferred
? I was playing around with multithreading, created a CompletableDeferred<SOME_DATA_CLASS>
on the main thread, froze it, passed it to a background thread , then passed it back to the main thread and called complete(SOME_VALUE)
on it. This seemed to actually work, but it doesn't seem like it should.caffeine
03/14/2021, 11:15 AMclass Buffer(val capacity:Int){private val mem = ByteArray(capacity); val ptr = mem.refTo(0);}
variable ptr
will be stable? Can I use value of ptr
during all object life cycle?Clocks
03/14/2021, 10:30 PMShannon Duncan
03/15/2021, 2:32 PMArtyom Degtyarev [JB]
03/15/2021, 3:28 PMClocks
03/17/2021, 2:48 AMkpgalligan
03/17/2021, 5:17 PMorg.jetbrains.kotlin:backend.native
published anywhere publicly accessible?charleskorn
03/18/2021, 4:09 AMCarmi Grushko
03/19/2021, 8:09 PMMichal Klimczak
03/20/2021, 10:11 PMfunc parser(XMLParser, didStartElement: String, namespaceURI: String?, qualifiedName: String?, attributes: [String : String])
//in kotlin native
override fun parser(
parser: NSXMLParser,
didStartElement: String,
namespaceURI: String?,
qualifiedName: String?,
attributes: Map<String, String>
)
An example of one that works fine for comparison:
func parser(XMLParser, parseErrorOccurred: Error)
override fun parser(parser: NSXMLParser, parseErrorOccurred: NSError)
Clocks
03/21/2021, 1:16 AMClocks
03/21/2021, 4:04 AMphisch
03/21/2021, 11:16 AMClocks
03/23/2021, 6:35 AMРолан
03/23/2021, 11:01 AMmemScoped
behaviour :
val qOut = memScoped {
val q = allocArray<IntVar>(6)
q[0] = 56
q
}
println(qOut[0]) //prints 56
shouldn't have the memory behind q
been released?napperley
03/24/2021, 9:45 PMCannot resolve external dependency org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.31 because no repositories are defined.
If the linuxArm32Hfp module is removed then the build works fine again like before.Clocks
03/25/2021, 3:40 AMEric O'Connell
03/26/2021, 9:45 PMnapperley
03/28/2021, 7:11 PMnimrod
03/28/2021, 9:46 PMNSNetServiceDelegateProtocol
, I don’t see any of the actual methods of that delegate, but only of the parent interface NSObjectProtocol
. Is this possible at all? Please see attached screenshot of the issue in Android Studio. Thanks!andylamax
03/29/2021, 7:12 AMToby
03/30/2021, 6:57 PMBig Chungus
03/31/2021, 2:54 PMBig Chungus
03/31/2021, 4:21 PMBig Chungus
03/31/2021, 7:24 PMlinkerOpts
would get found?
Also, is there a konan .def
file schema somewhere?Susheel
03/31/2021, 8:26 PM@Serializable
data class User(
@SerialName("UserName")
val name: String,
@SerialName("UserId")
val userID: String,
)
and yet I'm seeing the following exception
name: Error Domain=KotlinException Code=0 "No transformation found: class kotlin.ByteArray -> class com.xxx.kmmsharedmodule.User
in my kmm moduleMichal Klimczak
04/03/2021, 5:49 PMByteArray
to ios NSOutputtream
?
fun writeBytes(bytes: ByteArray, outputStream: NSOutputStream){
outputStream.write(WHAT NOW)
}
Or something similar that lets me write a byte stream to a file on ios.