Skip to content

Commit

Permalink
Removed unused coroutinescope from the RoomLifeCycleManager, added mi…
Browse files Browse the repository at this point in the history
…ssing

attach suspending method
  • Loading branch information
sacOO7 committed Oct 22, 2024
1 parent 0460c5c commit b5a5e54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions chat-android/src/main/java/com/ably/chat/RoomLifecycleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.ably.chat

import io.ably.lib.types.ErrorInfo
import io.ably.lib.util.Log.LogHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import io.ably.lib.realtime.Channel as AblyRealtimeChannel

/**
Expand Down Expand Up @@ -85,15 +83,6 @@ class RoomLifecycleManager
*/
private val _logger: LogHandler? = logger

/**
* sequentialCoroutineScope is to ensure the integrity and atomicity of operations that affect the room status, such as
* attaching, detaching, and releasing the room. It makes sure that we don't have multiple operations happening
* at once which could leave us in an inconsistent state.
* It is used as a CoroutineContext for with [kotlinx.coroutines.selects.select] statement.
* See [Kotlin Dispatchers](https://kt.academy/article/cc-dispatchers) for more information.
*/
private val sequentialCoroutineScope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))

/**
* This flag indicates whether some sort of controlled operation is in progress (e.g. attaching, detaching, releasing).
*
Expand All @@ -115,4 +104,8 @@ class RoomLifecycleManager
}
// TODO - [CHA-RL4] set up room monitoring here
}

suspend fun attach() {
TODO("Not yet implemented")
}
}
2 changes: 1 addition & 1 deletion chat-android/src/main/java/com/ably/chat/RoomStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class DefaultStatus(private val logger: LogHandler?) : InternalRoomStatus, RoomS
}

fun setStatus(status: RoomLifecycle, error: ErrorInfo? = null) {
val newStatus = object :NewRoomStatus {
val newStatus = object : NewRoomStatus {
override val status: RoomLifecycle = status
override val error: ErrorInfo? = error
}
Expand Down

0 comments on commit b5a5e54

Please sign in to comment.