-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
bugSomething isn't workingSomething isn't working
Description
👟 Reproduction steps
sdk-for-android/library/src/main/java/io/appwrite/services/Realtime.kt
Lines 116 to 123 in 85fac9d
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?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working