Interface IOpenPatricianLatch<T>

  • Type Parameters:
    T - typed parameter of this latch. This is the object type that is in the center of the event strands. A typical example could be INavigableVessel or IPlayer

    public interface IOpenPatricianLatch<T>
    A latch for OpenPatrician to allow one event strand to be split up into multiple parallel strand and and once all are finished be combined again. This is different from a traditional latch where an event strand would be a thread. Here the completion of event strands relies on in game time and specific events.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2018 Created on Oct 06, 2018
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canProceed()
      Check if all created event strands have completed and execution can continue.
      void done​(T what)
      Notify the latch that what is done with whatever was going on an the latch itself can update itself and check, if it can proceed.
      void preceed()
      Proceed with the execution of a single strand after every single strand are done.
      void splitt​(T startingEventStrandObject)
      Start with the splitting of a single event strand into various strands.
    • Method Detail

      • splitt

        void splitt​(T startingEventStrandObject)
        Start with the splitting of a single event strand into various strands. The various event strands do not have to do identical task, but once they are done they should report back with done(Object). The initial event strand object is identical as the event strand object of each created single strand.
        Parameters:
        startingEventStrandObject - event strand object with which is started.
      • done

        void done​(T what)
        Notify the latch that what is done with whatever was going on an the latch itself can update itself and check, if it can proceed.
        Parameters:
        what - object that was done with the execution.
      • canProceed

        boolean canProceed()
        Check if all created event strands have completed and execution can continue.
        Returns:
        true if all event strands are completed.
      • preceed

        void preceed()
        Proceed with the execution of a single strand after every single strand are done.