👟 Reproduction steps
|
launch { |
|
subCallDepth++ |
|
delay(DEBOUNCE_MILLIS) |
|
if (subCallDepth == 1) { |
|
createSocket() |
|
} |
|
subCallDepth-- |
|
} |
when call this job in multiple threads ,it may call createSocket twice times or more?
👍 Expected behavior
when call this job in multiple threads ,it may call createSocket once. It will be ok by this code .
private var subCallDepth = AtomicInteger(0)
delay(DEBOUNCE_MILLIS)
if (subCallDepth.compareAndSet(0,1)) {
createSocket()
}
👎 Actual Behavior
it may call createSocket twice times or more?
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
android
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
👟 Reproduction steps
sdk-for-android/library/src/main/java/io/appwrite/services/Realtime.kt
Lines 116 to 123 in 85fac9d
when call this job in multiple threads ,it may call createSocket twice times or more?
👍 Expected behavior
when call this job in multiple threads ,it may call createSocket once. It will be ok by this code .
👎 Actual Behavior
it may call createSocket twice times or more?
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
android
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?