Interface EntityRetrievalStrategy

    • Field Detail

      • STORE

        static final EntityRetrievalStrategy STORE
        Strategy that consists of retrieving entities from the Gateway state cache. Avoids making REST API requests in case the object is not present in the cache. If you want to perform actions when a requested entity is missing, use operators such as Mono.switchIfEmpty(Mono).

        Note that using this strategy can have some unintended consequences like being unable to fetch some entities not cached by the gateway, for example, private channels. If that is your use case, locally apply a method like GatewayDiscordClient.withRetrievalStrategy(EntityRetrievalStrategy) using REST.

      • STORE_FALLBACK_REST

        static final EntityRetrievalStrategy STORE_FALLBACK_REST
        Strategy that consists of retrieving entities from stores first, then hit the REST API if not found.