Class AbstractPooledSubsystem

  • All Implemented Interfaces:
    Subsystem
    Direct Known Subclasses:
    OneShotPooledSubsystem, RepeatingPooledSubsystem

    public abstract class AbstractPooledSubsystem
    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. Pooled subsystems share a common work queue, and so pooled subsystems should be careful to ensure that their tasks do not contain long-running operations (which includes any Thread.sleeps, Timers, while(true) loops, etc) or else other Subsystems will be unable to execute until the long-running operation has completed. If you need a Subsystem which is able to execute long-running operations without interfering with other Subsystems, use an IndependentSubsystem.
    See Also:
    AbstractIndependentSubsystem
    • Constructor Detail

      • AbstractPooledSubsystem

        public AbstractPooledSubsystem()
    • 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