Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Add async command framework using Java 21 language features #6518

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Commits on May 3, 2024

  1. JDK 21 (graal)

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    67d8638 View commit details
    Browse the repository at this point in the history
  2. wip

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    83f26e8 View commit details
    Browse the repository at this point in the history
  3. java 21

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    1c4ff6e View commit details
    Browse the repository at this point in the history
  4. Proper async, add mirrors of existing command code, move to wpilibj3 …

    …package
    
    Remove resources-as-executors
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    8cfc99f View commit details
    Browse the repository at this point in the history
  5. Spotless formatting and improved command group scheduling

    Track all running nested commands, not just top-level
    
    Allows checking for any running command and awaiting any nested command
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    cb44c64 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    be6b901 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c4a6126 View commit details
    Browse the repository at this point in the history
  8. Allow async commands to suspend on interrupt

    Incomplete implementation; breaks when a command interrupts a suspendable command of the same priority
    
    Add a standard unit for nanoseconds to support sub-millisecond pause precision
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    d6f42d4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fc0eac4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    298cefa View commit details
    Browse the repository at this point in the history
  11. stability

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    5200639 View commit details
    Browse the repository at this point in the history
  12. Stability

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    4bdc585 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a686e80 View commit details
    Browse the repository at this point in the history
  14. Delete logger

    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    03e3b26 View commit details
    Browse the repository at this point in the history
  15. Nuke sequences and parallel groups

    Code is more accessible when using methods directly instead of commands
    
    Significantly less complexity and risk of ordering issues
    
    Slightly risker since requirements need to be handled manually
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    c908796 View commit details
    Browse the repository at this point in the history
  16. Print all nested exceptions, not just the first cause

    Async command errors tend to be nested 3 or 4 deep
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    8d889ab View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    5a3ad53 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    8525a4f View commit details
    Browse the repository at this point in the history
  19. Revert "Delete logger"

    This reverts commit 03e3b26.
    SamCarlberg committed May 3, 2024
    Configuration menu
    Copy the full SHA
    7994bed View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. wip dump

    SamCarlberg committed May 9, 2024
    Configuration menu
    Copy the full SHA
    d24144a View commit details
    Browse the repository at this point in the history

Commits on May 11, 2024

  1. Replace virtual threads with raw Continuations

    Because continuations are hidden in an internal JDK package, we need to wrap them in our own classes. Requires force-opening the JDK modules to our own (unnamed) module.
    SamCarlberg committed May 11, 2024
    Configuration menu
    Copy the full SHA
    d570544 View commit details
    Browse the repository at this point in the history
  2. Drop throws Exception from AsyncCommand.run

    Rethrow runtime exceptions thrown by commands instead of wrapping them
    
    Add some documentation
    SamCarlberg committed May 11, 2024
    Configuration menu
    Copy the full SHA
    ce01728 View commit details
    Browse the repository at this point in the history
  3. Update examples

    SamCarlberg committed May 11, 2024
    Configuration menu
    Copy the full SHA
    b7e565b View commit details
    Browse the repository at this point in the history

Commits on May 12, 2024

  1. Configuration menu
    Copy the full SHA
    f39f7a3 View commit details
    Browse the repository at this point in the history
  2. Remove logging code

    SamCarlberg committed May 12, 2024
    Configuration menu
    Copy the full SHA
    de11138 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Improve deeply nested commands; add Sequence; documentation pass

    Remove some vestigial code
    SamCarlberg committed May 13, 2024
    Configuration menu
    Copy the full SHA
    4164ed2 View commit details
    Browse the repository at this point in the history
  2. Remove vestigial code

    SamCarlberg committed May 13, 2024
    Configuration menu
    Copy the full SHA
    861db2f View commit details
    Browse the repository at this point in the history

Commits on May 14, 2024

  1. Move command waiting logic to the scheduler

    Allows command groups and compositions to reuse logic
    SamCarlberg committed May 14, 2024
    Configuration menu
    Copy the full SHA
    2083f0e View commit details
    Browse the repository at this point in the history

Commits on May 15, 2024

  1. Allow commands to be suspended on interrupt

    Reframe default commands as suspendable minimum-priority commands
    SamCarlberg committed May 15, 2024
    Configuration menu
    Copy the full SHA
    22be42a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a691bc View commit details
    Browse the repository at this point in the history
  3. Track nested resources to allow partial ownership of compound mechanisms

    Ther permits the use of commands to control a subsystem comprised of two separate mechanisms that need to be controlled together (eg a pink arm) that would traditionally need to be controlled without using commands to avoid scenarios in which one mechanism is controlled and the other is not
    SamCarlberg committed May 15, 2024
    Configuration menu
    Copy the full SHA
    408d904 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2024

  1. Move default command knowledge to HardwareResource

    Scheduler now pulls the default command from resources, instead of keeping track internally
    SamCarlberg committed May 16, 2024
    Configuration menu
    Copy the full SHA
    a6aa306 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    3f21d4d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c5c8a4 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2024

  1. Coroutine injection

    Bump Java to 21.0.2 due to compiler bug in 21.0.1
    SamCarlberg committed May 19, 2024
    Configuration menu
    Copy the full SHA
    11fdca1 View commit details
    Browse the repository at this point in the history
  2. Spotless formatting

    SamCarlberg committed May 19, 2024
    Configuration menu
    Copy the full SHA
    ebd4a71 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2366f87 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ac94cc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    055980c View commit details
    Browse the repository at this point in the history
  6. Remove "async" moniker

    Move examples to "coroutine" package instead of "async"
    SamCarlberg committed May 19, 2024
    Configuration menu
    Copy the full SHA
    3ab52bd View commit details
    Browse the repository at this point in the history
  7. Add simple wait to coroutines

    Helpful for timed sequences without needing to wrap async methods in a command
    SamCarlberg committed May 19, 2024
    Configuration menu
    Copy the full SHA
    1321fd4 View commit details
    Browse the repository at this point in the history