Class AbstractIndependentSubsystem

  • All Implemented Interfaces:
    Subsystem
    Direct Known Subclasses:
    OneShotIndependentSubsystem, RepeatingIndependentSubsystem

    public abstract class AbstractIndependentSubsystem
    extends AbstractSubsystem
    Abstracts a system which uses resourceLocks and has some task (recurring or one-shot) to be performed. An example is PID control - monitor sensors and periodically set motor values based on this. Independent subsystems do not share a common work queue, and so independent subsystems are suitable for tasks which contain long-running operations (which includes any Thread.sleeps, Timers, while(true) loops, etc), as this will not affect other Subsystems' execution. However, there is more overhead involved with this. If you do not need a Subsystem which is able to execute long-running operations without interfering with other Subsystems, use a PooledSubsystem so that the workload can be shared among threads.
    See Also:
    AbstractPooledSubsystem
    • Constructor Detail

      • AbstractIndependentSubsystem

        public AbstractIndependentSubsystem()
    • Method Detail

      • getExecutorService

        public java.util.concurrent.ScheduledExecutorService getExecutorService()
        Description copied from class: AbstractSubsystem
        Get the executor service which executes this subsystem's tasks. This service may or may not be shared with other subsystems; for Independent subsystems it is never shared, and for Pooled subsystems it is always shared.
        Specified by:
        getExecutorService in class AbstractSubsystem
        Returns:
        the executor service.
        See Also:
        AbstractIndependentSubsystem, AbstractPooledSubsystem