Package 

Class ThreadListController


  • 
    public final class ThreadListController
    
                        

    Controller responsible for managing the Threads list state. It serves as a central place for the state management and business logic related to the Threads list.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final StateFlow<ThreadListState> state
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadListController(QueryThreadsRequest query, ChatClient chatClient, CoroutineScope scope, Function0<StateFlow<QueryThreadsState>> queryThreadsAsState)
    • Method Summary

      Modifier and Type Method Description
      final StateFlow<ThreadListState> getState()
      final Unit load() Force loads the first page of threads.
      final Unit loadNextPage() Loads the next page of threads (if possible).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThreadListController

        ThreadListController(QueryThreadsRequest query, ChatClient chatClient, CoroutineScope scope, Function0<StateFlow<QueryThreadsState>> queryThreadsAsState)
        Parameters:
        query - The QueryThreadsRequest object containing the parameters for querying threads.
        chatClient - The ChatClient instance for retrieving the Threads related data.
        scope - The CoroutineScope on which coroutines should be launched.
        queryThreadsAsState - Function that returns a StateFlow of QueryThreadsState.