Interface EventLoop

All Known Implementing Classes:
DefaultEventLoop

public interface EventLoop
EventLoop is a central place where all eventing will be orchestrated for a lifecycle of a component. Orchestration is usually needed around timings of redraws and and component state updates. Generic message type is a Spring Message and it's up to an EventLoop implementation how those are processed.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Contract to process event loop messages, possibly translating an event into some other type of event or events.
    static enum 
    Type of an events handled by an EventLoop.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    dispatch(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> messages)
    Dispatch Messages into an EventLoop from a Publisher.
    void
    dispatch(org.springframework.messaging.Message<?> message)
    Dispatch a Message into an EventLoop.
    reactor.core.publisher.Flux<? extends org.springframework.messaging.Message<?>>
    Return a Flux of Message events.
    <T> reactor.core.publisher.Flux<T>
    events(EventLoop.Type type, Class<T> clazz)
    Specialisation of events() which returns type safe stream filtered by given eventloop message type and message payload class type.
    <T> reactor.core.publisher.Flux<T>
    events(EventLoop.Type type, org.springframework.core.ParameterizedTypeReference<T> typeRef)
    Specialisation of events() which returns type safe stream filtered by given eventloop message type and message payload class type.
    reactor.core.publisher.Flux<KeyEvent>
    Specialisation of events() which returns type safe KeyEvents.
    reactor.core.publisher.Flux<MouseEvent>
    Specialisation of events() which returns type safe MouseEvents.
    void
    onDestroy(reactor.core.Disposable disposable)
    Register Disposable to get disposed when event loop terminates.
    reactor.core.publisher.Flux<String>
    Specialisation of events() which returns type safe {code signal} events.
    reactor.core.publisher.Flux<String>
    Specialisation of events() which returns type safe {code system} events.
    <T extends ViewEvent>
    reactor.core.publisher.Flux<T>
    viewEvents(Class<T> clazz)
    Specialisation of events() which returns type safe ViewEvents.
    <T extends ViewEvent>
    reactor.core.publisher.Flux<T>
    viewEvents(Class<T> clazz, View filterBy)
    Specialisation of events() which returns type safe ViewEvents.
    <T extends ViewEvent>
    reactor.core.publisher.Flux<T>
    viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef)
    Specialisation of events() which returns type safe ViewEvents.
    <T extends ViewEvent>
    reactor.core.publisher.Flux<T>
    viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef, View filterBy)
    Specialisation of events() which returns type safe ViewEvents.
  • Method Details

    • events

      reactor.core.publisher.Flux<? extends org.springframework.messaging.Message<?>> events()
      Return a Flux of Message events. When subscribed events will be received until disposed or EventLoop terminates.
      Returns:
      the events from an event loop
    • keyEvents

      reactor.core.publisher.Flux<KeyEvent> keyEvents()
      Specialisation of events() which returns type safe KeyEvents.
      Returns:
      the key events from an event loop
    • mouseEvents

      reactor.core.publisher.Flux<MouseEvent> mouseEvents()
      Specialisation of events() which returns type safe MouseEvents.
      Returns:
      the mouse events from an event loop
    • systemEvents

      reactor.core.publisher.Flux<String> systemEvents()
      Specialisation of events() which returns type safe {code system} events.
      Returns:
      the system events from an event loop
    • signalEvents

      reactor.core.publisher.Flux<String> signalEvents()
      Specialisation of events() which returns type safe {code signal} events.
      Returns:
      the signal events from an event loop
    • viewEvents

      <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(Class<T> clazz)
      Specialisation of events() which returns type safe ViewEvents.
      Type Parameters:
      T - the type to expect
      Parameters:
      clazz - the type class to filter
      Returns:
      the filtered events from an event loop
    • viewEvents

      <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef)
      Specialisation of events() which returns type safe ViewEvents.
      Type Parameters:
      T - the type to expect
      Parameters:
      typeRef - the parameterized type to filter
      Returns:
      the filtered events from an event loop
    • viewEvents

      <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(Class<T> clazz, View filterBy)
      Specialisation of events() which returns type safe ViewEvents.
      Type Parameters:
      T - the type to expect
      Parameters:
      clazz - the type class to filter
      filterBy - the view to filter
      Returns:
      the filtered events from an event loop
    • viewEvents

      <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef, View filterBy)
      Specialisation of events() which returns type safe ViewEvents.
      Type Parameters:
      T - the type to expect
      Parameters:
      typeRef - the parameterized type to filter
      filterBy - the view to filter
      Returns:
      the filtered events from an event loop
    • events

      <T> reactor.core.publisher.Flux<T> events(EventLoop.Type type, Class<T> clazz)
      Specialisation of events() which returns type safe stream filtered by given eventloop message type and message payload class type.
      Type Parameters:
      T - the type to expect
      Parameters:
      type - the eventloop message type to filter
      clazz - the type class to filter
      Returns:
      the filtered events from an event loop
    • events

      <T> reactor.core.publisher.Flux<T> events(EventLoop.Type type, org.springframework.core.ParameterizedTypeReference<T> typeRef)
      Specialisation of events() which returns type safe stream filtered by given eventloop message type and message payload class type.
      Type Parameters:
      T - the type to expect
      Parameters:
      type - the eventloop message type to filter
      typeRef - the parameterized type to filter
      Returns:
      the filtered events from an event loop
    • dispatch

      void dispatch(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> messages)
      Dispatch Messages into an EventLoop from a Publisher. Usually type is either Mono or Flux.
      Parameters:
      messages - the messages to dispatch
    • dispatch

      void dispatch(org.springframework.messaging.Message<?> message)
      Dispatch a Message into an EventLoop.
      Parameters:
      message - the message to dispatch
    • onDestroy

      void onDestroy(reactor.core.Disposable disposable)
      Register Disposable to get disposed when event loop terminates.
      Parameters:
      disposable - a disposable to dispose