Class ReactorDispatcher


  • public final class ReactorDispatcher
    extends Object
    Reactor is not thread-safe - all calls to Proton API's should be - on the Reactor Thread. Reactor works out-of-box for all event driven API - ex: onReceive - which could raise upon onSocketRead. Reactor didn't support API's like Send() out-of-box - which could potentially run on different thread to that of Reactor. So, the following utility class is used to generate an Event to hook into Reactor's event delegation pattern. It uses a Pipe as the IO on which Reactor Listens to. Cardinality: multiple ReactorDispatcher's could be attached to 1 Reactor. Each ReactorDispatcher should be initialized Synchronously - as it calls API in Reactor which is not thread-safe.