ericliuThe danger of asFlow() when converting Rx to CoroutinesRecently I ran into an ANR crash on Android, and it turned out the culprit is asFlow() in the kotlinx:kotlinx-coroutines-rx2 library when…3 min read·Dec 4, 2023--1--1
ericliuKotlin Coroutines GotchasSimplest use case: suspend functions, does async jobs sequentially.2 min read·Sep 30, 2022----
ericliuWhen WeakHashMap leaksWeakHashMap is used to avoid memory leaks, but there is a catch: the weak reference is on the key, not the value.1 min read·Aug 4, 2020----
ericliuNaming a CaptureCaptures Optional variables and name the captured variable foo .1 min read·Oct 17, 2019----
ericliuOne Caveat of Generics in SwiftRecently I was wondering how to implement PECS (Producers Extends Consumers Super) in Swift, and it turned out I could not.2 min read·Aug 11, 2018--1--1
ericliuinHackerNoon.comJava bits: 0xFF and 0xFFLI wrote a method to read a long typed number from an InputStream. The code is as follows:2 min read·Oct 31, 2017----
ericliuinAndroidPubJava: When to Use (n >> 8) & 0xff and When to Use (byte)(n >>> 8)Introduction3 min read·Oct 25, 2017----
ericliuinAndroidPubA Comparison of Performances between TreeMap and PriorityQueue in One Use CaseUse Case3 min read·Oct 9, 2017--1--1
ericliuHow to make RxJava’s repeatWhen and retryWhen work with SubjectsRecently we have a requirement to retry a network request after failures so I looked it up on the web and found that RxJava’s retryWhen…2 min read·Jul 13, 2017--1--1
ericliuinHackerNoon.comBrief introduction to AbstractQueuedSynchronizer by Using a Simple Mutex ExampleAbstractQueuedSynchronizer is a masterpiece java class authored by Doug Lea. It is the underlying data structure that provides the acquire…1 min read·Jun 4, 2017----