Package 

Interface FlagsStateListener


  • 
    public interface FlagsStateListener
    
                        

    Listener interface for receiving state change notifications from a FlagsClient.

    Implementations of this interface can be registered with a FlagsClient to receive callbacks whenever the client's state changes.

    • Method Summary

      Modifier and Type Method Description
      abstract Unit onStateChanged(FlagsClientState newState) Called when the state of the FlagsClient changes.
      • Methods inherited from class java.lang.Object

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

      • onStateChanged

         abstract Unit onStateChanged(FlagsClientState newState)

        Called when the state of the FlagsClient changes.

        Important: This method is called synchronously while holding internal locks. Implementations should be fast and non-blocking. If you need to perform long-running operations (network calls, database queries, heavy computation), dispatch them to a background thread.

        Exception handling: Exceptions thrown from this method will propagate to the caller and may crash the application if not caught. Subsequent listeners will not be notified if an exception is thrown. Always catch and handle exceptions within your implementation to prevent crashes and ensure other listeners are notified.

        Parameters:
        newState - The new state of the client.