ThreadListController

constructor(query: QueryThreadsRequest, chatClient: ChatClient = ChatClient.instance(), scope: CoroutineScope = CoroutineScope(DispatcherProvider.IO.limitedParallelism(1)), queryThreadsAsState: (CoroutineScope) -> StateFlow<QueryThreadsState?> = { stateScope -> chatClient.queryThreadsAsState( request = query, coroutineScope = stateScope, ) })

Parameters

query

The QueryThreadsRequest object containing the parameters for querying threads.

chatClient

The ChatClient instance for retrieving the Threads related data.

scope

The CoroutineScope the controller's work runs under, in a child scope that close cancels; the given scope itself is never cancelled. The default one outlives user sessions, so the list can follow the next user, and runs one task at a time.

queryThreadsAsState

Function that returns a StateFlow of QueryThreadsState, built in the given scope.