Package 

Object DispatcherProvider


  • 
    public class DispatcherProvider
    
                        

    Coroutine dispatchers used internally by Stream libraries. Should always be used instead of directly using Dispatchers or creating new dispatchers.

    Can be modified using set and reset for testing purposes.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private CoroutineDispatcher Main
      private CoroutineDispatcher IO
      public final static DispatcherProvider INSTANCE
    • Method Summary

      Modifier and Type Method Description
      final Unit set(CoroutineDispatcher mainDispatcher, CoroutineDispatcher ioDispatcher) Overrides the main (UI thread) and IO dispatcher.
      final Unit reset() Resets the dispatchers to their default values.
      final CoroutineDispatcher getMain()
      final CoroutineDispatcher getIO()
      final Unit setMain(CoroutineDispatcher Main)
      final Unit setIO(CoroutineDispatcher IO)
      • Methods inherited from class io.getstream.chat.android.core.internal.coroutines.DispatcherProvider

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

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

      • set

         final Unit set(CoroutineDispatcher mainDispatcher, CoroutineDispatcher ioDispatcher)

        Overrides the main (UI thread) and IO dispatcher. For testing purposes only.

      • reset

         final Unit reset()

        Resets the dispatchers to their default values. For testing purposes only.

      • getMain

         final CoroutineDispatcher getMain()
      • getIO

         final CoroutineDispatcher getIO()
      • setMain

         final Unit setMain(CoroutineDispatcher Main)
      • setIO

         final Unit setIO(CoroutineDispatcher IO)