Module jdash.events

Interface GDEventProducer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface GDEventProducer
    Interface that abstracts how events are produced on each iteration of the loop. Even though this is a functional interface and can technically be implemented with a lambda expression, GDEventProducer instances generally need to be stateful so they can compute the events to emit according to the results of the previous iterations.
    • Method Detail

      • awardedLevels

        static GDEventProducer awardedLevels()
        An event producer that requests the first page of the Awarded category on each iteration in order to detect changes. It may emit:
        • AwardedAdd when it detects that a level was added to the Awarded category
        • AwardedRemove when it detects that a level was removed from the Awarded category
        • AwardedUpdate when it detects a change in the data of a level present in the Awarded category
        Returns:
        a GDEventProducer
      • timelyLevels

        static GDEventProducer timelyLevels()
        An event producer that requests information on the current Daily level and Weekly demon on each iteration in order to detect when the Daily level or the Weekly demon changes. It may emit:
        Returns:
        a GDEventProducer
      • produce

        reactor.core.publisher.Flux<Object> produce​(GDClient client)
        Emits zero, one or more events by making requests using the given GDClient. The results of those requests can be processed and memorized between two calls of this method in order to generate relevant events, for example to detect changes between the results of two identical requests.
        Parameters:
        client - the client to use for requests
        Returns:
        a Flux emitting zero, one or more events according to the results of the requests